伙计我的apk可以在我自己的手机上工作,但我将它附加到Google Play商店。我从商店安装了应用程序,但它不起作用。 当我检查开发者控制台时,我看到此错误。 请帮帮我,我该怎么办?
java.lang.RuntimeException:
at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:2819)
at android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:2988)
at android.app.ActivityThread.-wrap14 (ActivityThread.java)
at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1631)
at android.os.Handler.dispatchMessage (Handler.java:102)
at android.os.Looper.loop (Looper.java:154) at android.app.ActivityThread.main (ActivityThread.java:6682)
at java.lang.reflect.Method.invoke (Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:1520)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1410)
Caused by: java.lang.ClassNotFoundException:
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 android.app.Instrumentation.newActivity (Instrumentation.java:1086)
at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:2809)
答案 0 :(得分:0)
将此添加到gradle.build:
defaultConfig {
...
minSdkVersion 14
targetSdkVersion 21
...
// Enabling multidex support.
multiDexEnabled true
}
dependencies {
compile 'com.android.support:multidex:1.0.0'
}
和 机器人:名称= “android.support.multidex.MultiDexApplication”
到AndroidManifest.xml中的<application />
来源: https://developer.android.com/studio/build/multidex.html
答案 1 :(得分:0)
执行@Sameer提到的步骤,并确保您的Instant Run已关闭。 截至我撰写此答案时,Instant Run仍然不完美,特别是在涉及Multidexed文件时。
关闭即时游戏,
(Mac Users)
>> Command + Comma (⌘ + ,)
>> "Build, Execution and Deployment" section
>> Instant Run
>> Disable the checkbox
>> (Window users, you may have to search, probably in the settings section)
现在清理您的项目并运行它。