Fail to build App due to Kotlin version #87
-
Hello! First I want to say this is an excellent idea to build, thanks for sharing and making it available. I'm having trouble though building my app on Android. I use Expo and during the Android app build, the Gradle build process fails with the following message: Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.1.15.
The class is loaded from /Users/user/.gradle/caches/transforms-3/2a80405be8e7ee490f549039c21797fc/transformed/jetified-kotlin-stdlib-1.6.10.jar!/kotlin/Unit.class
e: /Users/user/Projects/Code/app/node_modules/react-native-avoid-softinput/android/src/main/java/com/reactnativeavoidsoftinput/events/BaseAvoidSoftInputEvent.kt: (12, 55): Unresolved reference: apply
e: /Users/user/Projects/Code/app/node_modules/react-native-avoid-softinput/android/src/main/java/com/reactnativeavoidsoftinput/events/BaseAvoidSoftInputEvent.kt: (13, 5): Unresolved reference: putInt
w: Detected multiple Kotlin daemon sessions at build/kotlin/sessions
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-avoid-softinput:compileDebugKotlin'.
> Compilation error. See log for more 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.
* Get more help at https://help.gradle.org
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See https://docs.gradle.org/7.3.3/userguide/command_line_interface.html#sec:command_line_warnings
Execution optimizations have been disabled for 1 invalid unit(s) of work during this build to ensure correctness.
Please consult deprecation warnings for more details.
BUILD FAILED in 1m 37s
533 actionable tasks: 527 executed, 6 up-to-date
/Users/user/Projects/Code/app/android/gradlew exited with non-zero code: 1 Im using |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
So the issue was that the default kotlin version set in this package ( |
Beta Was this translation helpful? Give feedback.
-
Just in case anyone will stumble upon similar issue, you can check troubleshooting section in docs (contribution by @Randall71 🚀 ) |
Beta Was this translation helpful? Give feedback.
So the issue was that the default kotlin version set in this package (
AvoidSoftinput_kotlinVersion=1.3.50
) was not being overridden and version1.3.50
was causing problems with my project version. Changing the version to1.6.10
in the package source fixed the problem.