# multiplatform


09/23/2020, 1:23 PM
I have a KMP multi-platform library for Java-Swing, Android, iOS. There is no problem on Java-Swing, iOS, but an error is reported when used on Android. Has anyone encountered this kind of error? How to solve it, I have been doing it for a day... 1、KMP-common gradle/wrapper/ distributionUrl= xxx/ build.gradle.kts kotlin { jvm{ compilations.all { kotlinOptions.jvmTarget = "1.8" // Default value: "1.6" } } sourceSets{ val jvmMain by getting { dependencies { implementation(Deps.NGJvm.log_jvm_common) implementation (Deps.NGJvm.common_net) implementation(Deps.NGJvm.order_calculator) implementation(Deps.NGJvm.common_utils) } } } } 2、Java Swing --> It work well gradle/wrapper/ distributionUrl= xxx/ 3、Android --> build error build.gradle classpath '' implementation (''){ exclude group: 'com.xx.xx.common' exclude group: '' exclude group: 'com.xx.xx.sjst' } gradle/wrapper/ distributionUrl= xxx/ --------- Error messag ------------
Task apptransformClassesWithStackFramesFixerForDebug
Exception in thread "main" java.lang.IllegalArgumentException: Type without superclass: module-info at at at org.objectweb.asm.ClassVisitor.visit( at at org.objectweb.asm.ClassReader.accept( at org.objectweb.asm.ClassReader.accept( at at at at
Task apptransformClassesWithDesugarForDebug FAILED
FAILURE: Build failed with an exception.
I have found the root cause, AGP 3.x is not compatible with Kotlin 1.4.x in the Android project, otherwise there will be many compatibility issues Temporary solution version: reduce the Kotlin version to 1.3.x, the corresponding AGP is 3.1.2 Remaining question: If the AGP of the project is 3.1.x and I want to use Kotlin 1.4.x, what should I do?