将Android Studio更新为2.3后,我的应用程序在设备(Nexus 5X)中工作正常但每次我明确安装apk时都会崩溃

时间:2017-04-03 08:12:36

标签: android android-studio

我做了这些事情: 1)清理代码并删除/ build文件夹中的所有内容。 2)分析AndroidManifest.xml文件所有活动都有正确的包名称作为后缀

Multidex已启用

这些是我每次都得到的错误日志。:

  

E / AndroidRuntime:致命异常:主要                                                                       处理:com.android.packagename,PID:25752                                                                       java.lang.RuntimeException:无法实例化应用程序   com.android.packagename.BaseApplication:   java.lang.ClassNotFoundException:没找到类   " com.android.packagename.BaseApplication"在路径上:DexPathList [[zip   文件   " /data/app/com.android.packagename-1/base.apk"],nativeLibraryDirectories = [/数据/应用/ com.android.packagename-1 / LIB / arm64,   / system / lib64,/ vendor / lib64]]                                                                           在android.app.LoadedApk.makeApplication(LoadedApk.java:802)                                                                           在   android.app.ActivityThread.handleBindApplication(ActivityThread.java:5377)                                                                           在android.app.ActivityThread.-wrap2(ActivityThread.java)                                                                           在   android.app.ActivityThread $ H.handleMessage(ActivityThread.java:1545)                                                                           在android.os.Handler.dispatchMessage(Handler.java:102)                                                                           在android.os.Looper.loop(Looper.java:154)                                                                           在android.app.ActivityThread.main(ActivityThread.java:6119)                                                                           at java.lang.reflect.Method.invoke(Native Method)                                                                           在   com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:886)                                                                           在com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)                                                                        引起:java.lang.ClassNotFoundException:没找到类   " com.android.packagename.BaseApplication"在路径上:DexPathList [[zip   文件   " /data/app/com.android.packagename-1/base.apk"],nativeLibraryDirectories = [/数据/应用/ com.android.packagename-1 / LIB / arm64,   / system / lib64,/ vendor / lib64]]                                                                           在   dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)                                                                           at java.lang.ClassLoader.loadClass(ClassLoader.java:380)                                                                           在java.lang.ClassLoader.loadClass(ClassLoader.java:312)                                                                           在   android.app.Instrumentation.newApplication(Instrumentation.java:992)                                                                           在android.app.LoadedApk.makeApplication(LoadedApk.java:796)                                                                           在   android.app.ActivityThread.handleBindApplication(ActivityThread.java:5377)

                                                                    at android.app.ActivityThread.-wrap2(ActivityThread.java) 
                                                                    at
     

android.app.ActivityThread $ H.handleMessage(ActivityThread.java:1545)                                                                           在android.os.Handler.dispatchMessage(Handler.java:102)                                                                           在android.os.Looper.loop(Looper.java:154)                                                                           在android.app.ActivityThread.main(ActivityThread.java:6119)                                                                           at java.lang.reflect.Method.invoke(Native Method)                                                                           在   com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:886)

                                                                    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)

2 个答案:

答案 0 :(得分:0)

好的,尝试为目标api安装即时运行

或禁用Android工作室的即时游戏

有关instant run

的更多信息

答案 1 :(得分:0)

偏好设置 - >构建,执行,部署 - >即时运行 然后, function