morrowdigital / watermelondb-expo-plugin

119 stars 30 forks source link

Kotlin version error in Expo EAS android build. #31

Closed chunghn closed 7 months ago

chunghn commented 9 months ago

Eas build failed with android platform, while IOS works perfectly. eas build -e preview -p android --local --clear-cache

Error:

...

[RUN_GRADLEW] e: /private/var/folders/yd/qxz7404s5p98f_8jzmpcmz_40000gp/T/eas-build-local-nodejs/dbfcf4c0-c738-4391-880f-1ef23373a802/build/node_modules/expo-modules-core/android/src/main/java/expo/modules/kotlin/views/ViewTypeConverter.kt: (32, 56): Class 'kotlin.reflect.KClass' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
[RUN_GRADLEW] The class is loaded from /Users/michael/.gradle/caches/transforms-3/b685f5a93bba5ed034b201357f85394c/transformed/jetified-kotlin-stdlib-1.8.10.jar!/kotlin/reflect/KClass.class
[RUN_GRADLEW] FAILURE: Build failed with an exception.
[RUN_GRADLEW] * What went wrong:
[RUN_GRADLEW] Execution failed for task ':expo-modules-core:compileReleaseKotlin'.
[RUN_GRADLEW] > Compilation error. See log for more details
[RUN_GRADLEW] * Try:
[RUN_GRADLEW] > Run with --stacktrace option to get the stack trace.
[RUN_GRADLEW] > Run with --info or --debug option to get more log output.
[RUN_GRADLEW] > Run with --scan to get full insights.
[RUN_GRADLEW] * Get more help at https://help.gradle.org
[RUN_GRADLEW] BUILD FAILED in 20s
[RUN_GRADLEW] > Task :expo-modules-core:compileReleaseKotlin FAILED
[RUN_GRADLEW] w: Detected multiple Kotlin daemon sessions at build/kotlin/sessions
[RUN_GRADLEW] Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

If I remove the expo-build-properties in app.json, the build is success.

    "plugins": [
      "@morrowdigital/watermelondb-expo-plugin"
      // [
      //   "expo-build-properties",
      //   {
      //     "android": {
      //       "kotlinVersion": "1.6.10"
      //     }
      //   }
      // ]
    ]

package.json

    "@morrowdigital/watermelondb-expo-plugin": "^2.1.2",
    "@nozbe/watermelondb": "^0.27.1",
    "@nozbe/with-observables": "^1.6.0",
    "expo": "^49.0.21",
    "react": "18.2.0",
    "react-native": "0.72.5",

Please advice if there is any risk or any proper solution to fix it?

killerchip commented 7 months ago

This comes from the watermelondb suggestion based on this: https://github.com/Nozbe/WatermelonDB/issues/1311

if it builds for you, then you can ignore it.