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

Kotlin 2.0.20 incompatibility: NoSuchMethodError: 'org.jetbrains.kotlin.config.CompilerConfigurationKey org.jetbrains.kotlin.backend.konan.KonanConfigKeys$Companion.getBITCODE_EMBEDDING_MODE()' #95

Closed
ZacSweers opened this issue Jul 22, 2024 · 18 comments

Comments

@ZacSweers
Copy link

Looks like a simple breaking API change in the KonanConfigKeys.

> Task :samples:counter:linkReleaseFrameworkIosArm64 FAILED
e: Compilation failed: 'org.jetbrains.kotlin.config.CompilerConfigurationKey org.jetbrains.kotlin.backend.konan.KonanConfigKeys$Companion.getBITCODE_EMBEDDING_MODE()'

 * Source files: 
 * Compiler version: 2.0.20-Beta2
 * Output kind: FRAMEWORK

e: java.lang.NoSuchMethodError: 'org.jetbrains.kotlin.config.CompilerConfigurationKey org.jetbrains.kotlin.backend.konan.KonanConfigKeys$Companion.getBITCODE_EMBEDDING_MODE()'
        at co.touchlab.skie.context.MainSkieContext.<init>(MainSkieContext.kt:88)
        at co.touchlab.skie.entrypoint.EntrypointUtils$createMainSkieContext$$inlined$logBlocking$default$1.invokeSuspend(SkiePerformanceAnalytics.kt:155)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
@hoangchungk53qx1
Copy link

JetBrains/kotlin@2257006

Xcode 14 deprecates bitcode embedding support, and Xcode 15 removes it.
App Store limits bitcode submissions as well.

@TadeasKriz
Copy link
Collaborator

Thanks @ZacSweers for the report. I've got a 2.0.20-RC working with SKIE and will probably release a preview version this week.

@TadeasKriz
Copy link
Collaborator

TadeasKriz commented Aug 22, 2024

Unfortunately didn't get to release a preview as other things got in the way and there were some behavior changes in Kotlin 2.0.20 that require changes in SKIE tests.

Since Kotlin 2.0.20 is now out, we'll add support for it directly in the 0.9.0 release if all goes according to plan. Unfortunately we're now waiting for org.jetbrains.kotlin:kotlin-native-compiler-embeddable to become available (currently the latest is still 2.0.20-RC2).

@TadeasKriz
Copy link
Collaborator

@ZacSweers If you could give 0.9.0-RC.3 a try and let me know if you encounter any issues I'd appreciate it!

@ZacSweers
Copy link
Author

Testing here slackhq/circuit#1605

@ZacSweers
Copy link
Author

looks good on our end!

@lukaszkalnik
Copy link

I just tested SKIE 0.9.0-RC.3 with Kotlin 2.0.20 on a fairly simple project (Ktor client with some REST API defnitions) and when trying to build the XCFramework I get the following error:

e: java.lang.OutOfMemoryError: Java heap space
        at java.base/java.util.HashMap.resize(HashMap.java:702)
        at java.base/java.util.HashMap.putVal(HashMap.java:661)
        at java.base/java.util.HashMap.put(HashMap.java:610)
        at org.jetbrains.kotlin.backend.konan.optimizations.DevirtualizationAnalysis$DevirtualizationAnalysisImpl$ConstraintGraphBuilder.dfgNodeToConstraintNode(DevirtualizationAnalysis.kt:1803)
        at org.jetbrains.kotlin.backend.konan.optimizations.DevirtualizationAnalysis$DevirtualizationAnalysisImpl$ConstraintGraphBuilder.build(DevirtualizationAnalysis.kt:990)
        at org.jetbrains.kotlin.backend.konan.optimizations.DevirtualizationAnalysis$DevirtualizationAnalysisImpl.buildConstraintGraphPrecursor(DevirtualizationAnalysis.kt:815)
        at org.jetbrains.kotlin.backend.konan.optimizations.DevirtualizationAnalysis$DevirtualizationAnalysisImpl.buildConstraintGraph(DevirtualizationAnalysis.kt:781)
        at org.jetbrains.kotlin.backend.konan.optimizations.DevirtualizationAnalysis$DevirtualizationAnalysisImpl.analyze(DevirtualizationAnalysis.kt:469)
        at org.jetbrains.kotlin.backend.konan.optimizations.DevirtualizationAnalysis.run(DevirtualizationAnalysis.kt:1379)
        at org.jetbrains.kotlin.backend.konan.driver.phases.LTOKt.DevirtualizationAnalysisPhase$lambda$4(LTO.kt:65)
        at org.jetbrains.kotlin.backend.konan.driver.phases.LTOKt$$Lambda$3900/0x0000000302e6c1e0.invoke(Unknown Source)
        at org.jetbrains.kotlin.backend.common.phaser.PhaseBuildersKt$createSimpleNamedCompilerPhase$1.phaseBody(PhaseBuilders.kt:69)
        at org.jetbrains.kotlin.backend.common.phaser.SimpleNamedCompilerPhase.phaseBody(CompilerPhase.kt:226)
        at org.jetbrains.kotlin.backend.common.phaser.AbstractNamedCompilerPhase.invoke(CompilerPhase.kt:113)
        at org.jetbrains.kotlin.backend.konan.driver.PhaseEngine.runPhase(Machinery.kt:120)
        at org.jetbrains.kotlin.backend.konan.driver.phases.TopLevelPhasesKt.runCodegen(TopLevelPhases.kt:391)
        at org.jetbrains.kotlin.backend.konan.driver.phases.TopLevelPhasesKt.runBackendCodegen(TopLevelPhases.kt:352)
        at org.jetbrains.kotlin.backend.konan.driver.phases.TopLevelPhasesKt.compileModule(TopLevelPhases.kt:272)
        at org.jetbrains.kotlin.backend.konan.driver.phases.TopLevelPhasesKt.runBackend$lambda$12$runAfterLowerings(TopLevelPhases.kt:119)
        at org.jetbrains.kotlin.backend.konan.driver.phases.TopLevelPhasesKt.runBackend(TopLevelPhases.kt:139)
        at org.jetbrains.kotlin.backend.konan.driver.DynamicCompilerDriver.produceObjCFramework(DynamicCompilerDriver.kt:83)
        at org.jetbrains.kotlin.backend.konan.driver.DynamicCompilerDriver.run$lambda$2$lambda$1$lambda$0(DynamicCompilerDriver.kt:43)
        at org.jetbrains.kotlin.backend.konan.driver.DynamicCompilerDriver$$Lambda$2660/0x000000030282e410.invoke(Unknown Source)
        at org.jetbrains.kotlin.backend.konan.driver.PhaseEngine$Companion$startTopLevel$topLevelPhase$1.phaseBody(Machinery.kt:79)
        at org.jetbrains.kotlin.backend.konan.driver.PhaseEngine$Companion$startTopLevel$topLevelPhase$1.phaseBody(Machinery.kt:73)
        at org.jetbrains.kotlin.backend.common.phaser.SimpleNamedCompilerPhase.phaseBody(CompilerPhase.kt:226)
        at org.jetbrains.kotlin.backend.common.phaser.AbstractNamedCompilerPhase.invoke(CompilerPhase.kt:113)
        at org.jetbrains.kotlin.backend.konan.driver.PhaseEngine$Companion.startTopLevel(Machinery.kt:86)
        at org.jetbrains.kotlin.backend.konan.driver.DynamicCompilerDriver.run(DynamicCompilerDriver.kt:37)
        at org.jetbrains.kotlin.backend.konan.KonanDriver.run(KonanDriver.kt:135)
        at org.jetbrains.kotlin.cli.bc.K2Native.runKonanDriver(K2Native.kt:154)
        at org.jetbrains.kotlin.cli.bc.K2Native.doExecute(K2Native.kt:65)

@lukaszkalnik
Copy link

Ok, the issue seems to be gone after I have removed a broken import in one of the test files...
I don't know if it was a coincidence.

@radimjanda754
Copy link

Hello, fyi, I tried changing skie version from 0.8.2 to 0.9.0-RC.3 with kotlin 2.0.20 in my project, and encountered some weird error which I was not sure what to do about it

* What went wrong:
Execution failed for task ':X:mergeXDebugJavaResource'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.MergeJavaResWorkAction
> Illegal char <:> at index 26: \META-INF\co.touchlab.skie:configuration-annotations.kotlin_module

However I didn't do much research yet, since it is only RC version

@lukaszkalnik
Copy link

Did you try excluding the META-INF file in your Gradle build file?

@TadeasKriz
Copy link
Collaborator

@radimjanda754 Hi, could you send us the contents of \META-INF\co.touchlab.skie:configuration-annotations.kotlin_module file? We didn't get any similar reports so far, so it might be tricky to reproduce. Thanks!

@radimjanda754
Copy link

radimjanda754 commented Aug 30, 2024

@TadeasKriz

I'm not able to open this kotlin_module file through Android Studio

image

Illegal char <:> at index 26: \META-INF\co.touchlab.skie:configuration-annotations.kotlin_module

The error message sounds to me like there is problem with <:> character in the filename itself.

@TadeasKriz
Copy link
Collaborator

Yeah you might be right. Could you try with the 0.8.4 and report what the file is called?

@radimjanda754
Copy link

File in 0.8.4 is called

configuration-annotations.kotlin_module

image

@coreypett-cube
Copy link

coreypett-cube commented Aug 30, 2024

0.9.3-RC looks good on my end as well. Though, I have the follow warnings:

❯ ./gradlew assembleSharedDebugXCFramework                                                                                                                         ─╯
Configuration on demand is an incubating feature.
Type-safe project accessors is an incubating feature.
Configuration 'iosArm64CompileKlibraries' was resolved during configuration time.
This is a build performance and scalability issue.
See https://github.com/gradle/gradle/issues/2298
Run with --info for a stacktrace.
Configuration 'skieRuntimeForIosArm64CompileKlibraries' was resolved during configuration time.
This is a build performance and scalability issue.
See https://github.com/gradle/gradle/issues/2298
Run with --info for a stacktrace.
Configuration 'iosArm64DebugFrameworkExport' was resolved during configuration time.
This is a build performance and scalability issue.
See https://github.com/gradle/gradle/issues/2298
Run with --info for a stacktrace.
Configuration 'kotlinCompilerClasspath' was resolved during configuration time.
This is a build performance and scalability issue.
See https://github.com/gradle/gradle/issues/2298
Run with --info for a stacktrace.
Configuration 'skieCompilerPlugin' was resolved during configuration time.
This is a build performance and scalability issue.
See https://github.com/gradle/gradle/issues/2298
Run with --info for a stacktrace.
Configuration 'skieSubPlugin' was resolved during configuration time.
This is a build performance and scalability issue.
See https://github.com/gradle/gradle/issues/2298
Run with --info for a stacktrace.
Configuration 'kotlinCompilerPluginClasspathIosArm64Main' was resolved during configuration time.
This is a build performance and scalability issue.
See https://github.com/gradle/gradle/issues/2298
Run with --info for a stacktrace.
Configuration 'iosSimulatorArm64CompileKlibraries' was resolved during configuration time.
This is a build performance and scalability issue.
See https://github.com/gradle/gradle/issues/2298
Run with --info for a stacktrace.
Configuration 'skieRuntimeForIosSimulatorArm64CompileKlibraries' was resolved during configuration time.
This is a build performance and scalability issue.
See https://github.com/gradle/gradle/issues/2298
Run with --info for a stacktrace.
Configuration 'iosSimulatorArm64DebugFrameworkExport' was resolved during configuration time.
This is a build performance and scalability issue.
See https://github.com/gradle/gradle/issues/2298
Run with --info for a stacktrace.
Configuration 'kotlinCompilerPluginClasspathIosSimulatorArm64Main' was resolved during configuration time.
This is a build performance and scalability issue.
See https://github.com/gradle/gradle/issues/2298
Run with --info for a stacktrace.

One stacktrace:

java.lang.RuntimeException: Configuration 'kotlinCompilerPluginClasspathIosArm64Main' was resolved during configuration time.
This is a build performance and scalability issue.
See https://github.com/gradle/gradle/issues/2298
        at com.android.build.gradle.internal.DependencyResolutionChecks$registerDependencyCheck$4$1.execute(DependencyResolutionChecks.kt:72)
        at com.android.build.gradle.internal.DependencyResolutionChecks$registerDependencyCheck$4$1.execute(DependencyResolutionChecks.kt:55)
        at org.gradle.internal.code.DefaultUserCodeApplicationContext$CurrentApplication$1.execute(DefaultUserCodeApplicationContext.java:122)
        at org.gradle.internal.event.BroadcastDispatch$ActionInvocationHandler.dispatch(BroadcastDispatch.java:99)
        at org.gradle.internal.event.BroadcastDispatch$ActionInvocationHandler.dispatch(BroadcastDispatch.java:87)
        at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:43)
        at org.gradle.internal.event.BroadcastDispatch$SingletonDispatch.dispatch(BroadcastDispatch.java:268)
        at org.gradle.internal.event.BroadcastDispatch$SingletonDispatch.dispatch(BroadcastDispatch.java:170)
        at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:83)
        at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:69)
        at org.gradle.internal.event.BroadcastDispatch$CompositeDispatch.dispatch(BroadcastDispatch.java:381)
        at org.gradle.internal.event.BroadcastDispatch$CompositeDispatch.dispatch(BroadcastDispatch.java:272)
        at org.gradle.internal.event.ListenerBroadcast.dispatch(ListenerBroadcast.java:148)
        at org.gradle.internal.event.ListenerBroadcast.dispatch(ListenerBroadcast.java:37)
        at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:94)
        at jdk.proxy1/jdk.proxy1.$Proxy54.beforeResolve(Unknown Source)
        at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.performPreResolveActions(DefaultConfiguration.java:871)
        at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.access$600(DefaultConfiguration.java:154)
        at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$1.call(DefaultConfiguration.java:746)
        at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$1.call(DefaultConfiguration.java:739)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:200)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:195)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:73)
        at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.resolveGraphInBuildOperation(DefaultConfiguration.java:739)
        at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.lambda$resolveExclusivelyIfRequired$6(DefaultConfiguration.java:731)
        at org.gradle.api.internal.project.DefaultProjectStateRegistry$CalculatedModelValueImpl.update(DefaultProjectStateRegistry.java:505)
        at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.resolveExclusivelyIfRequired(DefaultConfiguration.java:723)
        at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.resolveGraphIfRequired(DefaultConfiguration.java:716)
        at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.access$500(DefaultConfiguration.java:154)
        at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$ResolverResultsResolutionResultProvider.getValue(DefaultConfiguration.java:690)
        at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$ResolverResultsResolutionResultProvider.getTaskDependencyValue(DefaultConfiguration.java:672)

@Syrou
Copy link

Syrou commented Sep 5, 2024

Any news for a sharp release for Kotlin 2.0.20?

@TadeasKriz
Copy link
Collaborator

Hey @Syrou, I'm returning to this to get a full release out. Need to fix the reported issues and release a new RC, once we know it's ready it'll go out. Thanks for the patience.

@TadeasKriz
Copy link
Collaborator

Forgot to close this, 0.9.0 has full Kotlin 2.0.20 support.

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

7 participants