jbendtsen / tiny-android-template

Minimalist Android Project w/o Gradle
MIT License
42 stars 6 forks source link

kotlin-pre: error when compiling kotlinx-coroutines-core-jvm.jar #7

Open jbgg opened 3 months ago

jbgg commented 3 months ago

Hi. I'm trying to compile in Linux OS (Debian).

The kotlin compiler of Debian package has not the library kotlinx-coroutines-core-jvm.jar. So I have to install kotlin-compiler from github release. I have tried with several version of java jdk.

In any case the error is:

Warning in sdk/kotlinc/lib/kotlinx-coroutines-core-jvm.jar:kotlinx/coroutines/debug/AgentPremain$DebugProbesTransformer.class:
Type `java.lang.instrument.ClassFileTransformer` was not found, it is required for default or static interface methods desugaring of `kotlinx.coroutines.debug.AgentPremain$DebugProbesTransformer`
Warning in sdk/kotlinc/lib/kotlinx-coroutines-core-jvm.jar:kotlinx/coroutines/debug/AgentPremain.class:
Type `sun.misc.SignalHandler` was not found, it is required for default or static interface methods desugaring of `kotlinx.coroutines.debug.AgentPremain$$InternalSyntheticLambda$2$677acd6fb4ca1651eb1c76ebe61d8c1a9f5aeadf35534bff63c38388e03cb9a0$0`
Info: Stripped invalid locals information from 29 methods.
Info in sdk/kotlinc/lib/kotlinx-coroutines-core-jvm.jar:kotlinx/coroutines/channels/ChannelsKt__Channels_commonKt.class:
Methods with invalid locals information:
  java.lang.Object kotlinx.coroutines.channels.ChannelsKt__Channels_commonKt.consumeEach(kotlinx.coroutines.channels.ReceiveChannel, kotlin.jvm.functions.Function1, kotlin.coroutines.Continuation)
  Information in locals-table is invalid with respect to the stack map table. Local refers to non-present stack map type for register: 7 with constraint OBJECT.
  java.lang.Object kotlinx.coroutines.channels.ChannelsKt__Channels_commonKt.toList(kotlinx.coroutines.channels.ReceiveChannel, kotlin.coroutines.Continuation)
  Information in locals-table is invalid with respect to the stack map table. Local refers to non-present stack map type for register: 15 with constraint OBJECT.
Info in sdk/kotlinc/lib/kotlinx-coroutines-core-jvm.jar:kotlinx/coroutines/channels/ChannelsKt__DeprecatedKt$map$1.class:
Methods with invalid locals information:
  java.lang.Object kotlinx.coroutines.channels.ChannelsKt__DeprecatedKt$map$1.invokeSuspend(java.lang.Object)
  Information in locals-table is invalid with respect to the stack map table. Local refers to non-present stack map type for register: 9 with constraint OBJECT.
Info in sdk/kotlinc/lib/kotlinx-coroutines-core-jvm.jar:kotlinx/coroutines/channels/ChannelsKt__DeprecatedKt$zip$2.class:
Methods with invalid locals information:
  java.lang.Object kotlinx.coroutines.channels.ChannelsKt__DeprecatedKt$zip$2.invokeSuspend(java.lang.Object)
  Information in locals-table is invalid with respect to the stack map table. Local refers to non-present stack map type for register: 10 with constraint OBJECT.
Info in sdk/kotlinc/lib/kotlinx-coroutines-core-jvm.jar:kotlinx/coroutines/channels/ChannelsKt__DeprecatedKt.class:
Methods with invalid locals information:
  java.lang.Object kotlinx.coroutines.channels.ChannelsKt__DeprecatedKt.elementAt(kotlinx.coroutines.channels.ReceiveChannel, int, kotlin.coroutines.Continuation)
  Information in locals-table is invalid with respect to the stack map table. Local refers to non-present stack map type for register: 4 with constraint INT.
  java.lang.Object kotlinx.coroutines.channels.ChannelsKt__DeprecatedKt.elementAtOrNull(kotlinx.coroutines.channels.ReceiveChannel, int, kotlin.coroutines.Continuation)
  Information in locals-table is invalid with respect to the stack map table. Local refers to non-present stack map type for register: 4 with constraint INT.
  java.lang.Object kotlinx.coroutines.channels.ChannelsKt__DeprecatedKt.first(kotlinx.coroutines.channels.ReceiveChannel, kotlin.coroutines.Continuation)
  Information in locals-table is invalid with respect to the stack map table. Local refers to non-present stack map type for register: 3 with constraint INT.
  java.lang.Object kotlinx.coroutines.channels.ChannelsKt__DeprecatedKt.firstOrNull(kotlinx.coroutines.channels.ReceiveChannel, kotlin.coroutines.Continuation)
  Information in locals-table is invalid with respect to the stack map table. Local refers to non-present stack map type for register: 6 with constraint INT.
  java.lang.Object kotlinx.coroutines.channels.ChannelsKt__DeprecatedKt.indexOf(kotlinx.coroutines.channels.ReceiveChannel, java.lang.Object, kotlin.coroutines.Continuation)
  Information in locals-table is invalid with respect to the stack map table. Local refers to non-present stack map type for register: 10 with constraint INT.
  java.lang.Object kotlinx.coroutines.channels.ChannelsKt__DeprecatedKt.last(kotlinx.coroutines.channels.ReceiveChannel, kotlin.coroutines.Continuation)
  Information in locals-table is invalid with respect to the stack map table. Local refers to non-present stack map type for register: 3 with constraint INT.
  java.lang.Object kotlinx.coroutines.channels.ChannelsKt__DeprecatedKt.lastIndexOf(kotlinx.coroutines.channels.ReceiveChannel, java.lang.Object, kotlin.coroutines.Continuation)
  Information in locals-table is invalid with respect to the stack map table. Local refers to non-present stack map type for register: 10 with constraint OBJECT.
  java.lang.Object kotlinx.coroutines.channels.ChannelsKt__DeprecatedKt.lastOrNull(kotlinx.coroutines.channels.ReceiveChannel, kotlin.coroutines.Continuation)
  Information in locals-table is invalid with respect to the stack map table. Local refers to non-present stack map type for register: 6 with constraint INT.
  java.lang.Object kotlinx.coroutines.channels.ChannelsKt__DeprecatedKt.single(kotlinx.coroutines.channels.ReceiveChannel, kotlin.coroutines.Continuation)
  Information in locals-table is invalid with respect to the stack map table. Local refers to non-present stack map type for register: 3 with constraint INT.
  java.lang.Object kotlinx.coroutines.channels.ChannelsKt__DeprecatedKt.singleOrNull(kotlinx.coroutines.channels.ReceiveChannel, kotlin.coroutines.Continuation)
  Information in locals-table is invalid with respect to the stack map table. Local refers to non-present stack map type for register: 6 with constraint INT.
  java.lang.Object kotlinx.coroutines.channels.ChannelsKt__DeprecatedKt.filterNotNullTo(kotlinx.coroutines.channels.ReceiveChannel, java.util.Collection, kotlin.coroutines.Continuation)
  Information in locals-table is invalid with respect to the stack map table. Local refers to non-present stack map type for register: 8 with constraint OBJECT.
  java.lang.Object kotlinx.coroutines.channels.ChannelsKt__DeprecatedKt.filterNotNullTo(kotlinx.coroutines.channels.ReceiveChannel, kotlinx.coroutines.channels.SendChannel, kotlin.coroutines.Continuation)
  Information in locals-table is invalid with respect to the stack map table. Local refers to non-present stack map type for register: 8 with constraint OBJECT.
  java.lang.Object kotlinx.coroutines.channels.ChannelsKt__DeprecatedKt.toChannel(kotlinx.coroutines.channels.ReceiveChannel, kotlinx.coroutines.channels.SendChannel, kotlin.coroutines.Continuation)
  Information in locals-table is invalid with respect to the stack map table. Local refers to non-present stack map type for register: 8 with constraint OBJECT.
  java.lang.Object kotlinx.coroutines.channels.ChannelsKt__DeprecatedKt.toCollection(kotlinx.coroutines.channels.ReceiveChannel, java.util.Collection, kotlin.coroutines.Continuation)
  Information in locals-table is invalid with respect to the stack map table. Local refers to non-present stack map type for register: 8 with constraint OBJECT.
  java.lang.Object kotlinx.coroutines.channels.ChannelsKt__DeprecatedKt.toMap(kotlinx.coroutines.channels.ReceiveChannel, java.util.Map, kotlin.coroutines.Continuation)
  Information in locals-table is invalid with respect to the stack map table. Local refers to non-present stack map type for register: 8 with constraint OBJECT.
  java.lang.Object kotlinx.coroutines.channels.ChannelsKt__DeprecatedKt.any(kotlinx.coroutines.channels.ReceiveChannel, kotlin.coroutines.Continuation)
  Information in locals-table is invalid with respect to the stack map table. Local refers to non-present stack map type for register: 3 with constraint INT.
  java.lang.Object kotlinx.coroutines.channels.ChannelsKt__DeprecatedKt.count(kotlinx.coroutines.channels.ReceiveChannel, kotlin.coroutines.Continuation)
  Information in locals-table is invalid with respect to the stack map table. Local refers to non-present stack map type for register: 8 with constraint OBJECT.
  java.lang.Object kotlinx.coroutines.channels.ChannelsKt__DeprecatedKt.maxWith(kotlinx.coroutines.channels.ReceiveChannel, java.util.Comparator, kotlin.coroutines.Continuation)
  Information in locals-table is invalid with respect to the stack map table. Local refers to non-present stack map type for register: 4 with constraint INT.
  java.lang.Object kotlinx.coroutines.channels.ChannelsKt__DeprecatedKt.minWith(kotlinx.coroutines.channels.ReceiveChannel, java.util.Comparator, kotlin.coroutines.Continuation)
  Information in locals-table is invalid with respect to the stack map table. Local refers to non-present stack map type for register: 4 with constraint INT.
  java.lang.Object kotlinx.coroutines.channels.ChannelsKt__DeprecatedKt.none(kotlinx.coroutines.channels.ReceiveChannel, kotlin.coroutines.Continuation)
  Information in locals-table is invalid with respect to the stack map table. Local refers to non-present stack map type for register: 3 with constraint INT.
Info in sdk/kotlinc/lib/kotlinx-coroutines-core-jvm.jar:kotlinx/coroutines/flow/FlowKt__ChannelsKt.class:
Methods with invalid locals information:
  java.lang.Object kotlinx.coroutines.flow.FlowKt__ChannelsKt.emitAllImpl$FlowKt__ChannelsKt(kotlinx.coroutines.flow.FlowCollector, kotlinx.coroutines.channels.ReceiveChannel, boolean, kotlin.coroutines.Continuation)
  Information in locals-table is invalid with respect to the stack map table. Local refers to non-present stack map type for register: 10 with constraint INT.
Info in sdk/kotlinc/lib/kotlinx-coroutines-core-jvm.jar:kotlinx/coroutines/flow/FlowKt__EmittersKt$onCompletion$$inlined$unsafeFlow$1.class:
Methods with invalid locals information:
  java.lang.Object kotlinx.coroutines.flow.FlowKt__EmittersKt$onCompletion$$inlined$unsafeFlow$1.collect(kotlinx.coroutines.flow.FlowCollector, kotlin.coroutines.Continuation)
  Information in locals-table is invalid with respect to the stack map table. Local refers to non-present stack map type for register: 9 with constraint OBJECT.
Info in sdk/kotlinc/lib/kotlinx-coroutines-core-jvm.jar:kotlinx/coroutines/flow/FlowKt__EmittersKt$onEmpty$$inlined$unsafeFlow$1.class:
Methods with invalid locals information:
  java.lang.Object kotlinx.coroutines.flow.FlowKt__EmittersKt$onEmpty$$inlined$unsafeFlow$1.collect(kotlinx.coroutines.flow.FlowCollector, kotlin.coroutines.Continuation)
  Information in locals-table is invalid with respect to the stack map table. Local refers to non-present stack map type for register: 12 with constraint INT.
Info in sdk/kotlinc/lib/kotlinx-coroutines-core-jvm.jar:kotlinx/coroutines/flow/SharedFlowImpl.class:
Methods with invalid locals information:
  java.lang.Object kotlinx.coroutines.flow.SharedFlowImpl.collect(kotlinx.coroutines.flow.FlowCollector, kotlin.coroutines.Continuation)
  Information in locals-table is invalid with respect to the stack map table. Local refers to non-present stack map type for register: 5 with constraint OBJECT.
Info in sdk/kotlinc/lib/kotlinx-coroutines-core-jvm.jar:kotlinx/coroutines/flow/StateFlowImpl.class:
Methods with invalid locals information:
  java.lang.Object kotlinx.coroutines.flow.StateFlowImpl.collect(kotlinx.coroutines.flow.FlowCollector, kotlin.coroutines.Continuation)
  Information in locals-table is invalid with respect to the stack map table. Local refers to non-present stack map type for register: 5 with constraint OBJECT.
Info: Some warnings are typically a sign of using an outdated Java toolchain. To fix, recompile the source with an updated toolchain.

The command is: d8 --intermediate "$KOTLIN_JVM" --classpath "$KOTLIN_STDLIB" --classpath "$ANDROID_JAR" --output build where KOTLIN_JVM is "kotlinx-coroutines-core-jvm.jar", KOTLIN_STDLIB is "kotlin-stdlib.jar" and "ANDROID_JAR" is the sdk/platforms/android-[28/30]/android.jar.

Any idea? Thanks.