在Kotlin中开发的Android库模块导出到Java应用程序导致失败的解决方案:Lkotlin / jvm / internal / Intrinsics

我在Kotlin开发了一个Android库模块 – 在一个Kotlin项目上进行了测试,并且一切正常。 使用gradle的maven-publishing插件,我生成了aar文件,并将它们上传到Maven服务器,所以后者我使用compile'group compile 'group:artifact:version'在Android Java应用程序中添加了lib。

库文件似乎被认可,但是,当我尝试启动存在于Lib的活动时,我得到以下堆栈跟踪:

 05-12 14:21:48.221 11735-11735/*****.*****.dev W/art: Unable to resolve Lbr/com/**********/dataform/renderengine/core/model/DataCollector; annotation class 182 05-12 14:21:48.222 11735-11735/*****.*****.dev W/art: Unable to resolve Lbr/com/**********/dataform/renderengine/core/model/DataCollector; annotation class 181 05-12 14:21:48.222 11735-11735/*****.*****.dev W/art: Unable to resolve Lbr/com/**********/dataform/renderengine/core/model/DataCollector; annotation class 181 05-12 14:21:48.223 11735-11735/*****.*****.dev W/art: Unable to resolve Lbr/com/**********/dataform/renderengine/core/model/Collect; annotation class 182 05-12 14:21:48.224 11735-11735/*****.*****.dev W/art: Unable to resolve Lbr/com/**********/dataform/renderengine/core/model/Collect; annotation class 180 05-12 14:21:48.224 11735-11735/*****.*****.dev W/art: Unable to resolve Lbr/com/**********/dataform/renderengine/core/model/Collect; annotation class 180 05-12 14:21:48.224 11735-11735/*****.*****.dev W/art: Unable to resolve Lbr/com/**********/dataform/renderengine/core/model/Collect; annotation class 179 05-12 14:21:48.225 11735-11735/*****.*****.dev W/art: Unable to resolve Lbr/com/**********/dataform/renderengine/core/model/Collect; annotation class 179 05-12 14:21:48.225 11735-11735/*****.*****.dev W/art: Unable to resolve Lbr/com/**********/dataform/renderengine/core/model/Collect; annotation class 180 05-12 14:21:48.225 11735-11735/*****.*****.dev W/art: Unable to resolve Lbr/com/**********/dataform/renderengine/core/model/Collect; annotation class 180 05-12 14:21:48.225 11735-11735/*****.*****.dev W/art: Unable to resolve Lbr/com/**********/dataform/renderengine/core/model/Collect; annotation class 179 05-12 14:21:48.226 11735-11735/*****.*****.dev W/art: Unable to resolve Lbr/com/**********/dataform/renderengine/core/model/Collect; annotation class 179 05-12 14:21:48.226 11735-11735/*****.*****.dev W/art: Unable to resolve Lbr/com/**********/dataform/renderengine/core/model/DataCollector; annotation class 180 05-12 14:21:48.227 11735-11735/*****.*****.dev W/art: Unable to resolve Lbr/com/**********/dataform/renderengine/core/model/DataCollector; annotation class 180 05-12 14:21:48.227 11735-11735/*****.*****.dev W/art: Unable to resolve Lbr/com/**********/dataform/renderengine/core/model/DataCollector; annotation class 179 05-12 14:21:48.227 11735-11735/*****.*****.dev W/art: Unable to resolve Lbr/com/**********/dataform/renderengine/core/model/DataCollector; annotation class 179 05-12 14:21:48.227 11735-11735/*****.*****.dev W/art: Unable to resolve Lbr/com/**********/dataform/renderengine/core/model/DataCollector; annotation class 180 05-12 14:21:48.228 11735-11735/*****.*****.dev W/art: Unable to resolve Lbr/com/**********/dataform/renderengine/core/model/DataCollector; annotation class 180 05-12 14:21:48.228 11735-11735/*****.*****.dev W/art: Unable to resolve Lbr/com/**********/dataform/renderengine/core/model/DataCollector; annotation class 179 05-12 14:21:48.228 11735-11735/*****.*****.dev W/art: Unable to resolve Lbr/com/**********/dataform/renderengine/core/model/DataCollector; annotation class 179 05-12 14:21:48.229 11735-11735/*****.*****.dev W/art: Unable to resolve Lbr/com/**********/dataform/renderengine/core/model/DataCollector; annotation class 179 05-12 14:21:48.229 11735-11735/*****.*****.dev W/art: Unable to resolve Lbr/com/**********/dataform/renderengine/core/model/DataCollector; annotation class 179 05-12 14:21:48.230 11735-11735/*****.*****.dev W/art: Unable to resolve Lbr/com/**********/dataform/renderengine/core/model/Feedback; annotation class 182 05-12 14:21:48.232 11735-11735/*****.*****.dev W/art: Unable to resolve Lbr/com/**********/dataform/renderengine/core/model/Feedback; annotation class 181 05-12 14:21:48.232 11735-11735/*****.*****.dev W/art: Unable to resolve Lbr/com/**********/dataform/renderengine/core/model/Feedback; annotation class 181 05-12 14:21:48.233 11735-11735/*****.*****.dev W/art: Unable to resolve Lbr/com/**********/dataform/renderengine/core/model/Entry; annotation class 182 05-12 14:21:48.233 11735-11735/*****.*****.dev W/art: Unable to resolve Lbr/com/**********/dataform/renderengine/core/model/Entry; annotation class 180 05-12 14:21:48.234 11735-11735/*****.*****.dev W/art: Unable to resolve Lbr/com/**********/dataform/renderengine/core/model/Entry; annotation class 180 05-12 14:21:48.234 11735-11735/*****.*****.dev W/art: Unable to resolve Lbr/com/**********/dataform/renderengine/core/model/Entry; annotation class 180 05-12 14:21:48.234 11735-11735/*****.*****.dev W/art: Unable to resolve Lbr/com/**********/dataform/renderengine/core/model/Entry; annotation class 180 05-12 14:21:48.235 11735-11735/*****.*****.dev W/art: Unable to resolve Lbr/com/**********/dataform/renderengine/core/model/Feedback; annotation class 179 05-12 14:21:48.235 11735-11735/*****.*****.dev W/art: Unable to resolve Lbr/com/**********/dataform/renderengine/core/model/Feedback; annotation class 179 05-12 14:21:48.272 11735-11735/*****.*****.dev I/art: Rejecting re-init on previously-failed class java.lang.Class<br.com.**********.dataform.renderengine.presentation.feedback.PieChartFeedback>: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/github/mikephil/charting/charts/PieChart; 05-12 14:21:48.273 11735-11735/*****.*****.dev I/art: at java.lang.Object java.lang.Class.newInstance!() (Class.java:-2) 05-12 14:21:48.273 11735-11735/*****.*****.dev I/art: at android.app.Activity android.app.Instrumentation.newActivity(java.lang.ClassLoader, java.lang.String, android.content.Intent) (Instrumentation.java:1078) 05-12 14:21:48.273 11735-11735/*****.*****.dev I/art: at android.app.Activity android.app.ActivityThread.performLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent) (ActivityThread.java:2557) 05-12 14:21:48.273 11735-11735/*****.*****.dev I/art: at void android.app.ActivityThread.handleLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:2726) 05-12 14:21:48.273 11735-11735/*****.*****.dev I/art: at void android.app.ActivityThread.-wrap12(android.app.ActivityThread, android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:-1) 05-12 14:21:48.273 11735-11735/*****.*****.dev I/art: at void android.app.ActivityThread$H.handleMessage(android.os.Message) (ActivityThread.java:1477) 05-12 14:21:48.273 11735-11735/*****.*****.dev I/art: at void android.os.Handler.dispatchMessage(android.os.Message) (Handler.java:102) 05-12 14:21:48.273 11735-11735/*****.*****.dev I/art: at void android.os.Looper.loop() (Looper.java:154) 05-12 14:21:48.273 11735-11735/*****.*****.dev I/art: at void android.app.ActivityThread.main(java.lang.String[]) (ActivityThread.java:6119) 05-12 14:21:48.273 11735-11735/*****.*****.dev I/art: at java.lang.Object java.lang.reflect.Method.invoke!(java.lang.Object, java.lang.Object[]) (Method.java:-2) 05-12 14:21:48.273 11735-11735/*****.*****.dev I/art: at void com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run() (ZygoteInit.java:886) 05-12 14:21:48.273 11735-11735/*****.*****.dev I/art: at void com.android.internal.os.ZygoteInit.main(java.lang.String[]) (ZygoteInit.java:776) 05-12 14:21:48.273 11735-11735/*****.*****.dev I/art: Caused by: java.lang.ClassNotFoundException: Didn't find class "com.github.mikephil.charting.charts.PieChart" on path: DexPathList[[zip file "/data/app/*****.*****.dev-2/base.apk", zip file "/data/app/*****.*****.dev-2/split_lib_dependencies_apk.apk", zip file "/data/app/*****.*****.dev-2/split_lib_slice_0_apk.apk", zip file "/data/app/*****.*****.dev-2/split_lib_slice_1_apk.apk", zip file "/data/app/*****.*****.dev-2/split_lib_slice_2_apk.apk", zip file "/data/app/*****.*****.dev-2/split_lib_slice_3_apk.apk", zip file "/data/app/*****.*****.dev-2/split_lib_slice_4_apk.apk", zip file "/data/app/*****.*****.dev-2/split_lib_slice_5_apk.apk", zip file "/data/app/*****.*****.dev-2/split_lib_slice_6_apk.apk", zip file "/data/app/*****.*****.dev-2/split_lib_slice_7_apk.apk", zip file "/data/app/*****.*****.dev-2/split_lib_slice_8_apk.apk", zip file "/data/app/*****.*****.dev-2/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/*****.*****.dev-2/lib/x86, /system/lib, /vendor/lib]] 05-12 14:21:48.273 11735-11735/*****.*****.dev I/art: at java.lang.Class dalvik.system.BaseDexClassLoader.findClass(java.lang.String) (BaseDexClassLoader.java:56) 05-12 14:21:48.273 11735-11735/*****.*****.dev I/art: at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String, boolean) (ClassLoader.java:380) 05-12 14:21:48.273 11735-11735/*****.*****.dev I/art: at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String) (ClassLoader.java:312) 05-12 14:21:48.273 11735-11735/*****.*****.dev I/art: at java.lang.Object java.lang.Class.newInstance!() (Class.java:-2) 05-12 14:21:48.273 11735-11735/*****.*****.dev I/art: at android.app.Activity android.app.Instrumentation.newActivity(java.lang.ClassLoader, java.lang.String, android.content.Intent) (Instrumentation.java:1078) 05-12 14:21:48.273 11735-11735/*****.*****.dev I/art: at android.app.Activity android.app.ActivityThread.performLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent) (ActivityThread.java:2557) 05-12 14:21:48.273 11735-11735/*****.*****.dev I/art: at void android.app.ActivityThread.handleLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:2726) 05-12 14:21:48.273 11735-11735/*****.*****.dev I/art: at void android.app.ActivityThread.-wrap12(android.app.ActivityThread, android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:-1) 05-12 14:21:48.273 11735-11735/*****.*****.dev I/art: at void android.app.ActivityThread$H.handleMessage(android.os.Message) (ActivityThread.java:1477) 05-12 14:21:48.273 11735-11735/*****.*****.dev I/art: at void android.os.Handler.dispatchMessage(android.os.Message) (Handler.java:102) 05-12 14:21:48.273 11735-11735/*****.*****.dev I/art: at void android.os.Looper.loop() (Looper.java:154) 05-12 14:21:48.273 11735-11735/*****.*****.dev I/art: at void android.app.ActivityThread.main(java.lang.String[]) (ActivityThread.java:6119) 05-12 14:21:48.273 11735-11735/*****.*****.dev I/art: at java.lang.Object java.lang.reflect.Method.invoke!(java.lang.Object, java.lang.Object[]) (Method.java:-2) 05-12 14:21:48.273 11735-11735/*****.*****.dev I/art: at void com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run() (ZygoteInit.java:886) 05-12 14:21:48.273 11735-11735/*****.*****.dev I/art: at void com.android.internal.os.ZygoteInit.main(java.lang.String[]) (ZygoteInit.java:776) 05-12 14:21:48.275 11735-11735/*****.*****.dev I/art: Rejecting re-init on previously-failed class java.lang.Class<br.com.**********.dataform.renderengine.presentation.FormActivity$assembleWizard$1>: java.lang.NoClassDefFoundError: Failed resolution of: Lkotlin/jvm/internal/Lambda; 05-12 14:21:48.275 11735-11735/*****.*****.dev I/art: at java.lang.Object java.lang.Class.newInstance!() (Class.java:-2) 05-12 14:21:48.275 11735-11735/*****.*****.dev I/art: at android.app.Activity android.app.Instrumentation.newActivity(java.lang.ClassLoader, java.lang.String, android.content.Intent) (Instrumentation.java:1078) 05-12 14:21:48.275 11735-11735/*****.*****.dev I/art: at android.app.Activity android.app.ActivityThread.performLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent) (ActivityThread.java:2557) 05-12 14:21:48.275 11735-11735/*****.*****.dev I/art: at void android.app.ActivityThread.handleLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:2726) 05-12 14:21:48.275 11735-11735/*****.*****.dev I/art: at void android.app.ActivityThread.-wrap12(android.app.ActivityThread, android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:-1) 05-12 14:21:48.276 11735-11735/*****.*****.dev I/art: at void android.app.ActivityThread$H.handleMessage(android.os.Message) (ActivityThread.java:1477) 05-12 14:21:48.276 11735-11735/*****.*****.dev I/art: at void android.os.Handler.dispatchMessage(android.os.Message) (Handler.java:102) 05-12 14:21:48.276 11735-11735/*****.*****.dev I/art: at void android.os.Looper.loop() (Looper.java:154) 05-12 14:21:48.276 11735-11735/*****.*****.dev I/art: at void android.app.ActivityThread.main(java.lang.String[]) (ActivityThread.java:6119) 05-12 14:21:48.276 11735-11735/*****.*****.dev I/art: at java.lang.Object java.lang.reflect.Method.invoke!(java.lang.Object, java.lang.Object[]) (Method.java:-2) 05-12 14:21:48.276 11735-11735/*****.*****.dev I/art: at void com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run() (ZygoteInit.java:886) 05-12 14:21:48.276 11735-11735/*****.*****.dev I/art: at void com.android.internal.os.ZygoteInit.main(java.lang.String[]) (ZygoteInit.java:776) 05-12 14:21:48.276 11735-11735/*****.*****.dev I/art: Caused by: java.lang.ClassNotFoundException: Didn't find class "kotlin.jvm.internal.Lambda" on path: DexPathList[[zip file "/data/app/*****.*****.dev-2/base.apk", zip file "/data/app/*****.*****.dev-2/split_lib_dependencies_apk.apk", zip file "/data/app/*****.*****.dev-2/split_lib_slice_0_apk.apk", zip file "/data/app/*****.*****.dev-2/split_lib_slice_1_apk.apk", zip file "/data/app/*****.*****.dev-2/split_lib_slice_2_apk.apk", zip file "/data/app/*****.*****.dev-2/split_lib_slice_3_apk.apk", zip file "/data/app/*****.*****.dev-2/split_lib_slice_4_apk.apk", zip file "/data/app/*****.*****.dev-2/split_lib_slice_5_apk.apk", zip file "/data/app/*****.*****.dev-2/split_lib_slice_6_apk.apk", zip file "/data/app/*****.*****.dev-2/split_lib_slice_7_apk.apk", zip file "/data/app/*****.*****.dev-2/split_lib_slice_8_apk.apk", zip file "/data/app/*****.*****.dev-2/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/*****.*****.dev-2/lib/x86, /system/lib, /vendor/lib]] 05-12 14:21:48.276 11735-11735/*****.*****.dev I/art: at java.lang.Class dalvik.system.BaseDexClassLoader.findClass(java.lang.String) (BaseDexClassLoader.java:56) 05-12 14:21:48.276 11735-11735/*****.*****.dev I/art: at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String, boolean) (ClassLoader.java:380) 05-12 14:21:48.276 11735-11735/*****.*****.dev I/art: at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String) (ClassLoader.java:312) 05-12 14:21:48.276 11735-11735/*****.*****.dev I/art: at java.lang.Object java.lang.Class.newInstance!() (Class.java:-2) 05-12 14:21:48.276 11735-11735/*****.*****.dev I/art: at android.app.Activity android.app.Instrumentation.newActivity(java.lang.ClassLoader, java.lang.String, android.content.Intent) (Instrumentation.java:1078) 05-12 14:21:48.276 11735-11735/*****.*****.dev I/art: at android.app.Activity android.app.ActivityThread.performLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent) (ActivityThread.java:2557) 05-12 14:21:48.276 11735-11735/*****.*****.dev I/art: at void android.app.ActivityThread.handleLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:2726) 05-12 14:21:48.276 11735-11735/*****.*****.dev I/art: at void android.app.ActivityThread.-wrap12(android.app.ActivityThread, android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:-1) 05-12 14:21:48.276 11735-11735/*****.*****.dev I/art: at void android.app.ActivityThread$H.handleMessage(android.os.Message) (ActivityThread.java:1477) 05-12 14:21:48.276 11735-11735/*****.*****.dev I/art: at void android.os.Handler.dispatchMessage(android.os.Message) (Handler.java:102) 05-12 14:21:48.276 11735-11735/*****.*****.dev I/art: at void android.os.Looper.loop() (Looper.java:154) 05-12 14:21:48.276 11735-11735/*****.*****.dev I/art: at void android.app.ActivityThread.main(java.lang.String[]) (ActivityThread.java:6119) 05-12 14:21:48.276 11735-11735/*****.*****.dev I/art: at java.lang.Object java.lang.reflect.Method.invoke!(java.lang.Object, java.lang.Object[]) (Method.java:-2) 05-12 14:21:48.276 11735-11735/*****.*****.dev I/art: at void com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run() (ZygoteInit.java:886) 05-12 14:21:48.276 11735-11735/*****.*****.dev I/art: at void com.android.internal.os.ZygoteInit.main(java.lang.String[]) (ZygoteInit.java:776) 05-12 14:21:48.482 11735-11735/*****.*****.dev E/AndroidRuntime: FATAL EXCEPTION: main Process: *****.*****.dev, PID: 11735 java.lang.NoClassDefFoundError: Failed resolution of: Lkotlin/jvm/internal/Intrinsics; at br.com.**********.dataform.renderengine.presentation.FormActivity.assembleWizard(FormActivity.kt:117) at br.com.**********.dataform.renderengine.presentation.FormActivity.onCreate(FormActivity.kt:71) at android.app.Activity.performCreate(Activity.java:6679) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2618) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726) at android.app.ActivityThread.-wrap12(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6119) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776) Caused by: java.lang.ClassNotFoundException: Didn't find class "kotlin.jvm.internal.Intrinsics" on path: DexPathList[[zip file "/data/app/*****.*****.dev-2/base.apk", zip file "/data/app/*****.*****.dev-2/split_lib_dependencies_apk.apk", zip file "/data/app/*****.*****.dev-2/split_lib_slice_0_apk.apk", zip file "/data/app/*****.*****.dev-2/split_lib_slice_1_apk.apk", zip file "/data/app/*****.*****.dev-2/split_lib_slice_2_apk.apk", zip file "/data/app/*****.*****.dev-2/split_lib_slice_3_apk.apk", zip file "/data/app/*****.*****.dev-2/split_lib_slice_4_apk.apk", zip file "/data/app/*****.*****.dev-2/split_lib_slice_5_apk.apk", zip file "/data/app/*****.*****.dev-2/split_lib_slice_6_apk.apk", zip file "/data/app/*****.*****.dev-2/split_lib_slice_7_apk.apk", zip file "/data/app/*****.*****.dev-2/split_lib_slice_8_apk.apk", zip file "/data/app/*****.*****.dev-2/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/*****.*****.dev-2/lib/x86, /system/lib, /vendor/lib]] at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56) at java.lang.ClassLoader.loadClass(ClassLoader.java:380) at java.lang.ClassLoader.loadClass(ClassLoader.java:312) at br.com.**********.dataform.renderengine.presentation.FormActivity.assembleWizard(FormActivity.kt:117) at br.com.**********.dataform.renderengine.presentation.FormActivity.onCreate(FormActivity.kt:71) at android.app.Activity.performCreate(Activity.java:6679) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2618) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726) at android.app.ActivityThread.-wrap12(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6119) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776) 

这是我的模块的build.gradle:

 apply plugin: 'com.android.library' apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' apply from : 'publish.gradle' android { compileSdkVersion 25 buildToolsVersion "25.0.3" defaultConfig { minSdkVersion 14 targetSdkVersion 25 versionCode 1 versionName libVersion testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } sourceSets { main.java.srcDirs += 'src/main/kotlin' } lintOptions { abortOnError false } } dependencies { // TEST compile fileTree(dir: 'libs', include: ['*.jar']) androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { exclude group: 'com.android.support', module: 'support-annotations' }) compile 'com.android.support:appcompat-v7:25.3.1' testCompile 'junit:junit:4.12' // GOOGLE compile 'com.google.code.gson:gson:2.8.0' compile "com.android.support:appcompat-v7:$appcompat" compile "com.android.support:cardview-v7:$appcompat" compile "com.android.support:design:$appcompat" // OTHER compile('org.simpleframework:simple-xml:2.7.+') { exclude module: 'stax' exclude module: 'stax-api' exclude module: 'xpp3' } compile 'com.github.PhilJay:MPAndroidChart:v3.0.2' compile 'org.apache.commons:commons-io:1.3.2' // RX ANDROID compile 'io.reactivex.rxjava2:rxandroid:2.0.1' compile 'io.reactivex.rxjava2:rxjava:2.0.1' // KOTLIN compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version" // ANKO compile "org.jetbrains.anko:anko-common:$anko_version" compile "org.jetbrains.anko:anko-sdk15:$anko_version" compile "org.jetbrains.anko:anko-support-v4:$anko_version" compile "org.jetbrains.anko:anko-appcompat-v7:$anko_version" } buildscript { repositories { jcenter() } dependencies { classpath "org.jetbrains.kotlin:kotlin-android-extensions:$kotlin_version" } } kapt { generateStubs = true } 

One Solution collect form web for “在Kotlin中开发的Android库模块导出到Java应用程序导致失败的解决方案:Lkotlin / jvm / internal / Intrinsics”

kotlin-stdlib-jre7工件不应该在Android上工作,它目前仅支持Java 6平台。 在定位Android时,应该使用为JRE 6构建的kotlin-stdlib

 // KOTLIN compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" 
  • 有没有可能为Java类添加“静态”扩展函数?
  • 在Kotlin中直接引用不带类的枚举实例
  • Kotlin:迭代一个具有解构条目的地图是不是可能的? 错误?
  • Kotlin数据类包含开放函数
  • 领域executeTransactionAsync不写入数据到数据库
  • Kotlin - @javadoc相当于
  • 什么是Kotlin Gradle依赖关系中的“实现”?
  • 无法将硬编码的字符串值传递给Kotlin中的@BindingAdapter
  • 如何使用Maven编译Java + Kotlin项目?
  • 模拟方法出错
  • Kotlin函数类型而不是函数接口lambda
  • Kotlin language will be the best programming language for Android.