[英]Strange RuntimeException when running an android app on some devices
I have recently made an Android application and released the debug version to some people for testing purposes. 我最近制作了一个Android应用程序并将测试版本发布给某些人用于测试目的。 All seems fine except to a few devices the app could not be run.
一切似乎都很好,除了一些设备无法运行应用程序。 After investigation the following exception was occurring when opening the app:
调查后,打开应用程序时发生以下异常:
E/AndroidRuntime: FATAL EXCEPTION: main
Process: ir.irancell.neshan, PID: 23340
java.lang.RuntimeException: Unable to instantiate application com.android.tools.fd.runtime.BootstrapApplication: java.lang.ClassNotFoundException: Didn't find class "com.android.tools.fd.runtime.BootstrapApplication" on path: DexPathList[[zip file "/data/app/ir.irancell.neshan-1.apk"],nativeLibraryDirectories=[/data/app-lib/ir.irancell.neshan-1, /vendor/lib, /system/lib]]
at android.app.LoadedApk.makeApplication(LoadedApk.java:516)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4722)
at android.app.ActivityThread.access$1600(ActivityThread.java:172)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1368)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:146)
at android.app.ActivityThread.main(ActivityThread.java:5653)
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:1291)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.android.tools.fd.runtime.BootstrapApplication" on path: DexPathList[[zip file "/data/app/ir.irancell.neshan-1.apk"],nativeLibraryDirectories=[/data/app-lib/ir.irancell.neshan-1, /vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:67)
at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
at android.app.Instrumentation.newApplication(Instrumentation.java:981)
at android.app.LoadedApk.makeApplication(LoadedApk.java:511)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4722)
at android.app.ActivityThread.access$1600(ActivityThread.java:172)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1368)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:146)
at android.app.ActivityThread.main(ActivityThread.java:5653)
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:1291)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107)
at dalvik.system.NativeStart.main(Native Method)
Strangely when I connect those problemed devices to Android Studio and compile the app specifically for them the app runs just fine. 奇怪的是,当我将那些有问题的设备连接到Android Studio并专门为他们编译应用程序时,应用运行得很好。 But if I generate an APK file and install them separately some devices still have that problem.
但是,如果我生成一个APK文件并单独安装它们,一些设备仍然存在这个问题。
Googling the issue, some say ( here and here ) that the culprit is the Instant Run
feature but I don't think Instant Run
is responsible when you use Generate signed APK
. 谷歌搜索问题,有人说( 这里和这里 )罪魁祸首是
Instant Run
功能,但我不认为当您使用Generate signed APK
时, Instant Run
是负责任的。 So what could be the problem? 那可能是什么问题呢?
Yup, it seems that Instant Run
was the culprit here. 是的,看来
Instant Run
是这里的罪魁祸首。 So disabling it resolved the issue. 所以禁用它解决了这个问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.