Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version compatibility between the Compose Compiler and the Kotlin Compiler on Android #106

Open
Kweeku opened this issue Sep 2, 2024 · 2 comments

Comments

@Kweeku
Copy link

Kweeku commented Sep 2, 2024

I have this error when running my application on android with the smile package added.

Launching lib/main.dart on sdk gphone64 arm64 in debug mode... ERROR:/Users/user/.gradle/caches/transforms-3/34918811f3bb0948f1fad9e737055413/transformed/lifecycle-livedata-core-2.8.4-runtime.jar: D8: java.lang.NullPointerException: Cannot invoke "String.length()" because "<parameter1>" is null e: java.lang.Error: Something went wrong while checking for version compatibility between the Compose Compiler and the Kotlin Compiler. It is possible that the versions are incompatible. Please verify your kotlin version and consult the Compose-Kotlin compatibility map located at https://developer.android.com/jetpack/androidx/releases/compose-kotlin at androidx.compose.compiler.plugins.kotlin.ComposePluginRegistrar$Companion.checkCompilerVersion(ComposePlugin.kt:286) at androidx.compose.compiler.plugins.kotlin.ComposePluginRegistrar.registerProjectComponents(ComposePlugin.kt:211) at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment$Companion.registerExtensionsFromPlugins$cli(KotlinCoreEnvironment.kt:655) at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment$ProjectEnvironment.registerExtensionsFromPlugins(KotlinCoreEnvironment.kt:169) at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment$Companion.configureProjectEnvironment(KotlinCoreEnvironment.kt:566) at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment.<init>(KotlinCoreEnvironment.kt:199) at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment.<init>(KotlinCoreEnvironment.kt:108) at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment$Companion.createForProduction(KotlinCoreEnvironment.kt:445) at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.createCoreEnvironment(K2JVMCompiler.kt:191) at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:142) at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:52) at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:94) at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:43) at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:101) at org.jetbrains.kotlin.incremental.IncrementalJvmCompilerRunner.runCompiler(IncrementalJvmCompilerRunner.kt:477) at org.jetbrains.kotlin.incremental.IncrementalJvmCompilerRunner.runCompiler(IncrementalJvmCompilerRunner.kt:127) at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compileIncrementally(IncrementalCompilerRunner.kt:366) at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compileIncrementally$default(IncrementalCompilerRunner.kt:311) at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.rebuild(IncrementalCompilerRunner.kt:110) at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compileImpl(IncrementalCompilerRunner.kt:200) at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compile(IncrementalCompilerRunner.kt:75) at org.jetbrains.kotlin.daemon.CompileServiceImplBase.execIncrementalCompiler(CompileServiceImpl.kt:625) at org.jetbrains.kotlin.daemon.CompileServiceImplBase.access$execIncrementalCompiler(CompileServiceImpl.kt:101) at org.jetbrains.kotlin.daemon.CompileServiceImpl.compile(CompileServiceImpl.kt:1739) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.base/java.lang.reflect.Method.invoke(Unknown Source) at java.rmi/sun.rmi.server.UnicastServerRef.dispatch(Unknown Source) 2 at java.rmi/sun.rmi.transport.Transport$1.run(Unknown Source) at java.base/java.security.AccessController.doPrivileged(Unknown Source) at java.rmi/sun.rmi.transport.Transport.serviceCall(Unknown Source) at java.rmi/sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source) at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(Unknown Source) at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(Unknown Source) at java.base/java.security.AccessController.doPrivileged(Unknown Source) at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.base/java.lang.Thread.run(Unknown Source) Caused by: java.lang.NoSuchMethodError: 'void org.jetbrains.kotlin.cli.common.messages.MessageCollector.report$default(org.jetbrains.kotlin.cli.common.messages.MessageCollecto

This error is from an example project created with the flutter create command. It is also the same issue I have in my actual flutter project. I will appreciate a looking into this matter as my compnay wishes to launch our product with smile in the coming weeks. Thanks

@jumaallan
Copy link
Member

Hey @Kweeku

this is similar to this issue here - #95

This should be the fix you need - #95 (comment)

@CoderNamedHendrick
Copy link

I tried the fix that was suggested in the comment, I'm currently getting a new error.

 Incompatible classes were found in dependencies. Remove them from the classpath or use '-Xskip-metadata-version-check' to suppress errors
e: file:///Users/sebastineodeh/.gradle/caches/8.9/transforms/080aaad6019f01aed680642bbda10f09/transformed/jetified-kotlin-stdlib-2.1.0.jar!/META-INF/kotlin-stdlib-jdk7.kotlin_moduleModule was compiled with an incompatible version of Kotlin. The binary version of its metadata is 2.1.0, expected version is 1.9.0.
e: file:///Users/sebastineodeh/.gradle/caches/8.9/transforms/080aaad6019f01aed680642bbda10f09/transformed/jetified-kotlin-stdlib-2.1.0.jar!/META-INF/kotlin-stdlib-jdk8.kotlin_moduleModule was compiled with an incompatible version of Kotlin. The binary version of its metadata is 2.1.0, expected version is 1.9.0.
e: file:///Users/sebastineodeh/.gradle/caches/8.9/transforms/080aaad6019f01aed680642bbda10f09/transformed/jetified-kotlin-stdlib-2.1.0.jar!/META-INF/kotlin-stdlib.kotlin_moduleModule was compiled with an incompatible version of Kotlin. The binary version of its metadata is 2.1.0, expected version is 1.9.0.
e: file:///Users/sebastineodeh/.gradle/caches/8.9/transforms/320457dc51e0273c28ce3bfca2836070/transformed/jetified-android-sdk-10.4.0-api.jar!/META-INF/com.smileidentity_android-sdk_release.kotlin_moduleModule was compiled with an incompatible version of Kotlin. The binary version of its metadata is 2.1.0, expected version is 1.9.0.
e: file:///Users/sebastineodeh/.pub-cache/hosted/pub.dev/smile_id-10.3.1/android/src/main/kotlin/com/smileidentity/flutter/Mapper.kt:47:33 Class 'com.smileidentity.models.ActionResult' was compiled with an incompatible version of Kotlin. The actual metadata version is 2.1.0, but the compiler version 1.9.0 can read versions up to 2.0.0.
The class is loaded from /Users/sebastineodeh/.gradle/caches/8.9/transforms/320457dc51e0273c28ce3bfca2836070/transformed/jetified-android-sdk-10.4.0-api.jar!/com/smileidentity/models/ActionResult.class
e: file:///Users/sebastineodeh/.pub-cache/hosted/pub.dev/smile_id-10.3.1/android/src/main/kotlin/com/smileidentity/flutter/Mapper.kt:48:33 Class 'com.smileidentity.models.Actions' was compiled with an incompatible version of Kotlin. The actual metadata version is 2.1.0, but the compiler version 1.9.0 can read versions up to 2.0.0.
The class is loaded from /Users/sebastineodeh/.gradle/caches/8.9/transforms/320457dc51e0273c28ce3bfca2836070/transformed/jetified-android-sdk-10.4.0-api.jar!/com/smileidentity/models/Actions.class
e: file:///Users/sebastineodeh/.pub-cache/hosted/pub.dev/smile_id-10.3.1/android/src/main/kotlin/com/smileidentity/flutter/Mapper.kt:49:33 Class 'com.smileidentity.models.Antifraud' was compiled with an incompatible version of Kotlin. The actual metadata version is 2.1.0, but the compiler version 1.9.0 can read versions up to 2.0.0.
The class is loaded from /Users/sebastineodeh/.gradle/caches/8.9/transforms/320457dc51e0273c28ce3bfca2836070/transformed/jetified-android-sdk-10.4.0-api.jar!/com/smileidentity/models/Antifraud.class
e: file:///Users/sebastineodeh/.pub-cache/hosted/pub.dev/smile_id-10.3.1/android/src/main/kotlin/com/smileidentity/flutter/Mapper.kt:50:33 Class 'com.smileidentity.models.AuthenticationRequest' was compiled with an incompatible version of Kotlin. The actual metadata version is 2.1.0, but the compiler version 1.9.0 can read versions up to 2.0.0.
The class is loaded from /Users/sebastineodeh/.gradle/caches/8.9/transforms/320457dc51e0273c28ce3bfca2836070/transformed/jetified-android-sdk-10.4.0-api.jar!/com/smileidentity/models/AuthenticationRequest.class
e: file:///Users/sebastineodeh/.pub-cache/hosted/pub.dev/smile_id-10.3.1/android/src/main/kotlin/com/smileidentity/flutter/Mapper.kt:51:33 Class 'com.smileidentity.models.AuthenticationResponse' was compiled with an incompatible version of Kotlin. The actual metadata version is 2.1.0, but the compiler version 1.9.0 can read versions up to 2.0.0.
The class is loaded from /Users/sebastineodeh/.gradle/caches/8.9/transforms/320457dc51e0273c28ce3bfca2836070/transformed/jetified-android-sdk-10.4.0-api.jar!/com/smileidentity/models/AuthenticationResponse.class
e: file:///Users/sebastineodeh/.pub-cache/hosted/pub.dev/smile_id-10.3.1/android/src/main/kotlin/com/smileidentity/flutter/Mapper.kt:52:33 Class 'com.smileidentity.models.AvailableIdType' was compiled with an incompatible version of Kotlin. The actual metadata version is 2.1.0, but the compiler version 1.9.0 can read versions up to 2.0.0.
The class is loaded from /Users/sebastineodeh/.gradle/caches/8.9/transforms/320457dc51e0273c28ce3bfca2836070/transformed/jetified-android-sdk-10.4.0-api.jar!/com/smileidentity/models/AvailableIdType.class
e: file:///Users/sebastineodeh/.pub-cache/hosted/pub.dev/smile_id-10.3.1/android/src/main/kotlin/com/smileidentity/flutter/Mapper.kt:53:33 Class 'com.smileidentity.models.BankCode' was compiled with an incompatible version of Kotlin. The actual metadata version is 2.1.0, but the compiler version 1.9.0 can read versions up to 2.0.0.
The class is loaded from /Users/sebastineodeh/.gradle/caches/8.9/transforms/320457dc51e0273c28ce3bfca2836070/transformed/jetified-android-sdk-10.4.0-api.jar!/com/smileidentity/models/BankCode.class
e: file:///Users/sebastineodeh/.pub-cache/hosted/pub.dev/smile_id-10.3.1/android/src/main/kotlin/com/smileidentity/flutter/Mapper.kt:54:33 Class 'com.smileidentity.models.BiometricKycJobResult' was compiled with an incompatible version of Kotlin. The actual metadata version is 2.1.0, but the compiler version 1.9.0 can read versions up to 2.0.0.
The class is loaded from /Users/sebastineodeh/.gradle/caches/8.9/transforms/320457dc51e0273c28ce3bfca2836070/transformed/jetified-android-sdk-10.4.0-api.jar!/com/smileidentity/models/BiometricKycJobResult.class
e: file:///Users/sebastineodeh/.pub-cache/hosted/pub.dev/smile_id-10.3.1/android/src/main/kotlin/com/smileidentity/flutter/Mapper.kt:55:33 Class 'com.smileidentity.models.BiometricKycJobStatusResponse' was compiled with an incompatible version of Kotlin. The actual metadata version is 2.1.0, but the compiler version 1.9.0 can read versions up to 2.0.0.
The class is loaded from /Users/sebastineodeh/.gradle/caches/8.9/transforms/320457dc51e0273c28ce3bfca2836070/transformed/jetified-android-sdk-10.4.0-api.jar!/com/smileidentity/models/BiometricKycJobStatusResponse.class
e: file:///Users/sebastineodeh/.pub-cache/hosted/pub.dev/smile_id-10.3.1/android/src/main/kotlin/com/smileidentity/flutter/Mapper.kt:56:33 Class 'com.smileidentity.models.Config' was compiled with an incompatible version of Kotlin. The actual metadata version is 2.1.0, but the compiler version 1.9.0 can read versions up to 2.0.0.
The class is loaded from /Users/sebastineodeh/.gradle/caches/8.9/transforms/320457dc51e0273c28ce3bfca2836070/transformed/jetified-android-sdk-10.4.0-api.jar!/com/smileidentity/models/Config.class
e: file:///Users/sebastineodeh/.pub-cache/hosted/pub.dev/smile_id-10.3.1/android/src/main/kotlin/com/smileidentity/flutter/Mapper.kt:57:33 Class 'com.smileidentity.models.ConsentInfo' was compiled with an incompatible version of Kotlin. The actual metadata version is 2.1.0, but the compiler version 1.9.0 can read versions up to 2.0.0.
The class is loaded from /Users/sebastineodeh/.gradle/caches/8.9/transforms/320457dc51e0273c28ce3bfca2836070/transformed/jetified-android-sdk-10.4.0-api.jar!/com/smileidentity/models/ConsentInfo.class
e: file:///Users/sebastineodeh/.pub-cache/hosted/pub.dev/smile_id-10.3.1/android/src/main/kotlin/com/smileidentity/flutter/Mapper.kt:58:33 Class 'com.smileidentity.models.Country' was compiled with an incompatible version of Kotlin. The actual metadata version is 2.1.0, but the compiler version 1.9.0 can read versions up to 2.0.0.
The class is loaded from /Users/sebastineodeh/.gradle/caches/8.9/transforms/320457dc51e0273c28ce3bfca2836070/transformed/jetified-android-sdk-10.4.0-api.jar!/com/smileidentity/models/Country.class
e: file:///Users/sebastineodeh/.pub-cache/hosted/pub.dev/smile_id-10.3.1/android/src/main/kotlin/com/smileidentity/flutter/Mapper.kt:59:33 Class 'com.smileidentity.models.CountryInfo' was compiled with an incompatible version of Kotlin. The actual metadata version is 2.1.0, but the compiler version 1.9.0 can read versions up to 2.0.0.
The class is loaded from /Users/sebastineodeh/.gradle/caches/8.9/transforms/320457dc51e0273c28ce3bfca2836070/transformed/jetified-android-sdk-10.4.0-api.jar!/com/smileidentity/models/CountryInfo.class
e: file:///Users/sebastineodeh/.pub-cache/hosted/pub.dev/smile_id-10.3.1/android/src/main/kotlin/com/smileidentity/flutter/Mapper.kt:60:33 Class 'com.smileidentity.models.DocumentVerificationJobResult' was compiled with an incompatible version of Kotlin. The actual metadata version is 2.1.0, but the compiler version 1.9.0 can read versions up to 2.0.0.
The class is loaded from /Users/sebastineodeh/.gradle/caches/8.9/transforms/320457dc51e0273c28ce3bfca2836070/transformed/jetified-android-sdk-10.4.0-api.jar!/com/smileidentity/models/DocumentVerificationJobResult.class
e: file:///Users/sebastineodeh/.pub-cache/hosted/pub.dev/smile_id-10.3.1/android/src/main/kotlin/com/smileidentity/flutter/Mapper.kt:61:33 Class 'com.smileidentity.models.DocumentVerificationJobStatusResponse' was compiled with an incompatible version of Kotlin. The actual metadata version is 2.1.0, but the compiler version 1.9.0 can read versions up to 2.0.0.
The class is loaded from /Users/sebastineodeh/.gradle/caches/8.9/transforms/320457dc51e0273c28ce3bfca2836070/transformed/jetified-android-sdk-10.4.0-api.jar!/com/smileidentity/models/DocumentVerificationJobStatusResponse.class
e: file:///Users/sebastineodeh/.pub-cache/hosted/pub.dev/smile_id-10.3.1/android/src/main/kotlin/com/smileidentity/flutter/Mapper.kt:62:33 Class 'com.smileidentity.models.EnhancedDocumentVerificationJobResult' was compiled with an incompatible version of Kotlin. The actual metadata version is 2.1.0, but the compiler version 1.9.0 can read versions up to 2.0.0.
The class is loaded from /Users/sebastineodeh/.gradle/caches/8.9/transforms/320457dc51e0273c28ce3bfca2836070/transformed/jetified-android-sdk-10.4.0-api.jar!/com/smileidentity/models/EnhancedDocumentVerificationJobResult.class
e: file:///Users/sebastineodeh/.pub-cache/hosted/pub.dev/smile_id-10.3.1/android/src/main/kotlin/com/smileidentity/flutter/Mapper.kt:63:33 Class 'com.smileidentity.models.EnhancedDocumentVerificationJobStatusResponse' was compiled with an incompatible version of Kotlin. The actual metadata version is 2.1.0, but the compiler version 1.9.0 can read versions up to 2.0.0.

It seems we don't have a choice but to update to kotlin 2.1.0. Or do you have any suggestions to resolve this @jumaallan ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
@jumaallan @CoderNamedHendrick @Kweeku and others