skip to Main Content

A few hours before, there’s no issue when i run the React Native app on Android. Even it successfully built on Azure DevOps.

until when i tried to run the app again and this happens:

* What went wrong:
Execution failed for task ':expo-splash-screen:compileDebugKotlin'.
> Compilation error. See log for more details

I trace the logs and it shows this message:

> Task :expo-splash-screen:compileDebugKotlin FAILED
w: Runtime JAR files in the classpath should have the same version. These files were found in the classpath:
    /Users/s000-50105204/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk8/1.6.10/e80fe6ac3c3573a80305f5ec43f86b829e8ab53d/kotlin-stdlib-jdk8-1.6.10.jar (version 1.6)
    /Users/s000-50105204/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk7/1.6.10/e1c380673654a089c4f0c9f83d0ddfdc1efdb498/kotlin-stdlib-jdk7-1.6.10.jar (version 1.6)
    /Users/s000-50105204/.gradle/caches/transforms-2/files-2.1/ecefa6f1392695b7079790a9cdc8d4ee/jetified-kotlin-reflect-1.3.50.jar (version 1.3)
    /Users/s000-50105204/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.6.10/b8af3fe6f1ca88526914929add63cf5e7c5049af/kotlin-stdlib-1.6.10.jar (version 1.6)
    /Users/s000-50105204/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.6.10/c118700e3a33c8a0d9adc920e9dec0831171925/kotlin-stdlib-common-1.6.10.jar (version 1.6)
w: Some runtime JAR files in the classpath have an incompatible version. Consider removing them from the classpath

After i browse for solutions, i found a solution by adding this line in build.gradle to use kotlin 1.6.10:

dependencies {
        classpath 'com.google.gms:google-services:4.3.4'
        classpath("com.android.tools.build:gradle:3.5.4")
        classpath 'com.google.firebase:firebase-crashlytics-gradle:2.8.1'
        classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10' <==== ADDED THIS LINE
    }

But when i run the app again, it shows different error message like this:

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

I trace the logs and found this:

/Users/s000-50105204/Documents/react-native/Mobil88_MobileApps_Estore/node_modules/@unimodules/react-native-adapter/android/src/main/java/org/unimodules/adapters/react/services/CookieManagerModule.java:13: error: CookieManagerModule is not abstract and does not override abstract method invalidate() in NativeModule
public class CookieManagerModule extends ForwardingCookieHandler implements InternalModule, NativeModule {
       ^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

This is the buildscript in build.gradle:

    ext {
        buildToolsVersion = "30.0.2"
        minSdkVersion = 21
        compileSdkVersion = 31
        targetSdkVersion = 31
    }

This is dependencies on the packages.json for the project:

  "dependencies": {
    "@ptomasroos/react-native-multi-slider": "^2.2.2",
    "@react-native-async-storage/async-storage": "^1.15.8",
    "@react-native-clipboard/clipboard": "^1.8.4",
    "@react-native-community/geolocation": "^2.0.2",
    "@react-native-firebase/app": "^14.7.0",
    "@react-native-firebase/auth": "^14.7.0",
    "@react-native-firebase/crashlytics": "^14.7.0",
    "@react-native-firebase/messaging": "^14.7.0",
    "@react-native-masked-view/masked-view": "^0.2.6",
    "@redux-devtools/extension": "^3.2.2",
    "@sentry/react-native": "^2.5.0",
    "axios": "^0.21.2",
    "expo": "^38.0.0",
    "expo-analytics-amplitude": "~8.2.1",
    "expo-apple-authentication": "~2.2.1",
    "expo-asset": "~8.1.7",
    "expo-crypto": "~8.2.1",
    "expo-firebase-analytics": "~2.4.1",
    "expo-firebase-core": "~1.1.1",
    "expo-font": "~8.2.1",
    "expo-google-sign-in": "~8.2.1",
    "expo-secure-store": "~9.0.1",
    "expo-updates": "~0.2.10",
    "firebase": "7.9.0",
    "install": "^0.13.0",
    "jwt-decode": "^3.0.0",
    "lodash.isequal": "^4.5.0",
    "moment": "^2.22.2",
    "npm": "^6.14.13",
    "prop-types": "^15.6.1",
    "qs": "^6.5.2",
    "react": "~16.11.0",
    "react-dom": "~16.11.0",
    "react-native": "~0.62.2",
    "react-native-animatable": "~1.3.0",
    "react-native-background-timer": "^2.4.1",
    "react-native-camera": "^4.2.1",
    "react-native-check-version": "^1.0.16",
    "react-native-checkbox": "~2.0.0",
    "react-native-collapsible": "^1.6.0",
    "react-native-config": "^1.4.2",
    "react-native-copilot": "^2.5.1",
    "react-native-countdown-component": "^2.7.1",
    "react-native-datepicker": "~1.7.2",
    "react-native-device-info": "^8.0.8",
    "react-native-easy-toast": "~1.1.0",
    "react-native-elements": "~0.19.1",
    "react-native-email-link": "1.13.1",
    "react-native-exit-app": "^1.1.0",
    "react-native-fast-image": "^8.5.11",
    "react-native-fbsdk-next": "^4.2.0",
    "react-native-gesture-handler": "~1.6.0",
    "react-native-image-picker": "^4.0.6",
    "react-native-image-zoom-viewer": "^3.0.1",
    "react-native-linear-gradient": "^2.5.6",
    "react-native-maps": "0.27.1",
    "react-native-modal-wrapper": "~3.1.1",
    "react-native-network-logger": "^1.13.0",
    "react-native-picker-select": "~5.1.0",
    "react-native-progress": "^5.0.0",
    "react-native-reanimated": "~1.9.0",
    "react-native-screens": "~2.9.0",
    "react-native-shake": "^5.1.1",
    "react-native-skeleton-placeholder": "^5.0.0",
    "react-native-smooth-pincode-input": "1.0.9",
    "react-native-snap-carousel": "3.9.1",
    "react-native-status-bar-height": "^2.6.0",
    "react-native-svg": "12.1.0",
    "react-native-tab-view": "~1.2.0",
    "react-native-tip": "0.0.18",
    "react-native-tracking-transparency": "^0.1.0",
    "react-native-unimodules": "~0.10.1",
    "react-native-vector-icons": "~6.6.0",
    "react-native-webview": "11.0.0",
    "react-navigation": "3.13.0",
    "react-redux": "^5.0.7",
    "redux": "^4.0.1",
    "redux-logger": "^3.0.6",
    "redux-thunk": "^2.3.0",
    "toggle-switch-react-native": "^3.2.0"
  }

Is it the kotlin version? or the expo packages?

I cannot find any solutions for this issue, because it was fine before, no changes made and suddenly this happens. Been stuck for 2 days, it can’t even run on emulator, and can’t even build on Azure anymore

2

Answers


  1. Chosen as BEST ANSWER

    After looking for solutions, i found the solution Here

    Looks like that on November 4th 2022 when React Native 0.71rc released, all android builds are failing.

    I added the patch code on android/build.gradle provided in the solution on the link above.


  2. same

    there is no change with my code

    i can’t run on emulator

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search