我在带有Kotlin插件1.3.11的Ubuntu 16.04上使用Android Studio 3.2.1。如果我将具有Android Studio的应用程序部署到具有KitKat(API 19)的虚拟设备,则该应用程序已启动但立即崩溃。操作系统显示“很遗憾,已停止。我在调试器控制台中看到以下异常:
W/dalvikvm: threadid=1: thread exiting with uncaught exception (group=0x9ccbbb20)
E/AndroidRuntime: FATAL EXCEPTION: main
Process: info.diethealth.app, PID: 2583
java.lang.VerifyError: com/fasterxml/jackson/module/kotlin/KotlinNamesAnnotationIntrospector
at com.fasterxml.jackson.module.kotlin.KotlinModule.setupModule(KotlinModule.kt:40)
at com.fasterxml.jackson.databind.ObjectMapper.registerModule(ObjectMapper.java:722)
at com.fasterxml.jackson.module.kotlin.ExtensionsKt.registerKotlinModule(Extensions.kt:15)
at info.diethealth.app.business.dagger.DietHealthApiModule.provideObjectMapper(DietHealthApiModule.kt:20)
at info.diethealth.app.business.dagger.DietHealthApiModule_ProvideObjectMapperFactory.get(DietHealthApiModule_ProvideObjectMapperFactory.java:23)
at info.diethealth.app.business.dagger.DietHealthApiModule_ProvideObjectMapperFactory.get(DietHealthApiModule_ProvideObjectMapperFactory.java:8)
at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
at info.diethealth.app.business.dagger.DietHealthApiModule_ProvidesRetrofitFactory.get(DietHealthApiModule_ProvidesRetrofitFactory.java:37)
at info.diethealth.app.business.dagger.DietHealthApiModule_ProvidesRetrofitFactory.get(DietHealthApiModule_ProvidesRetrofitFactory.java:11)
at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
at info.diethealth.app.business.dagger.DietHealthApiModule_ProvidesDietHealthApiFactory.get(DietHealthApiModule_ProvidesDietHealthApiFactory.java:31)
at info.diethealth.app.business.dagger.DietHealthApiModule_ProvidesDietHealthApiFactory.get(DietHealthApiModule_ProvidesDietHealthApiFactory.java:10)
at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
at info.diethealth.app.business.dagger.DietHealthServicesModule_ProvidesRecipeDescriptionServiceFactory.get(DietHealthServicesModule_ProvidesRecipeDescriptionServiceFactory.java:69)
at info.diethealth.app.business.dagger.DietHealthServicesModule_ProvidesRecipeDescriptionServiceFactory.get(DietHealthServicesModule_ProvidesRecipeDescriptionServiceFactory.java:16)
at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
at info.diethealth.app.components.main.MainActivity_MembersInjector.injectMembers(MainActivity_MembersInjector.java:31)
at info.diethealth.app.components.main.MainActivity_MembersInjector.injectMembers(MainActivity_MembersInjector.java:8)
at info.diethealth.app.business.dagger.DaggerDietHealthComponent.inject(DaggerDietHealthComponent.java:242)
at info.diethealth.app.components.main.MainActivity.onCreate(MainActivity.kt:50)
at android.app.Activity.performCreate(Activity.java:5231)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
at android.app.ActivityThread.access$800(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)
棒棒糖(5.0,5.1)或棉花糖(6.0)没问题。