Home > database >  My another React Native was working fine upto 4 November, but now throwing an exception while Runnin
My another React Native was working fine upto 4 November, but now throwing an exception while Runnin

Time:11-11

Prior to 4 November it was working fine and now when I am trying to build it by running yarn android but it is showing me

Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
/Users/dev/Desktop/Abc Projects/aargee/node_modules/react-native-webrtc/android/src/main/java/com/oney/WebRTCModule/VideoTrackAdapter.java:5: error: cannot access VideoFrame
import org.webrtc.VideoFrame;
                 ^
  bad class file: /Users/dev/.gradle/caches/transforms-2/files-2.1/8af035e80c335f19cef40762b46ee77a/jetified-libwebrtc.jar(org/webrtc/VideoFrame.class)
    class file has wrong version 55.0, should be 52.0
    Please remove or make sure it appears in the correct subdirectory of the classpath.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-webrtc:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

"react-native": "^0.66.3", "react-native-webrtc": "^1.94.1",

I have tried solution from My React Native was working fine upto 4 November but now throwing an exception while Running yarn android but no luck. Any help will be appreciated.

CodePudding user response:

  1. Remove android/.idea, android/.gradle, android\build & android\app\build folders from your project if exist
  2. Remove gradle cache like mentioned here : https://stackoverflow.com/a/30450020/10657559
  3. Then follow the method mentioned here : https://stackoverflow.com/a/74371195/10657559

CodePudding user response:

Replace the below section in android/build.gradle

allprojects {
    repositories {
     mavenCentral()
     google()
     jcenter()
        maven {
            // Android JSC is installed from npm
            url("$rootDir/../node_modules/jsc-android/dist")
        }
        maven { url 'https://www.jitpack.io' }
        exclusiveContent {
           filter {
               includeGroup "com.facebook.react"
           }
           forRepository {
               maven {
                   url "$rootDir/../node_modules/react-native/android"
               }
           }
       }
    }
}
  • Related