简体   繁体   English

在某些设备上运行Android应用程序时出现Strange RuntimeException

[英]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.

相关问题 在某些设备上运行但未在其他设备上运行时找不到Android类 - Android class not found when running on some devices but not on others Android App未在其他设备上运行 - Android App is not running on other devices Android Opengl es 1 - asynctask在某些设备上导致奇怪的行为 - Android Opengl es 1 - asynctask causing strange behaviour on some devices Android 应用程序在某些设备中无故崩溃 - Android app crashes in some devices for no apparent reason Android应用无法在之前使用过的某些设备上运行 - Android app not working on some devices that it was working on before 在ANDROID中在Background上运行时获取java.lang.RunTimeException - Getting java.lang.RunTimeException when running on Background in ANDROID Android App在模拟器上运行,但在真实设备上崩溃 - Android App running on Emulator but crashes on real devices Android Java 应用程序 - 发出通知时,发送者会收到通知,但运行该应用程序的其他设备不会 - Android Java App - When firing a notification the sender gets it but other devices running the app do not 在某些设备上录制音频时,Android IllegalStateException - Android IllegalStateException when recording audio on some devices 应用程序未在 android 版本 4.4.2(KITKAT) 上运行,但在其他设备上运行良好 - App not running on android version 4.4.2(KITKAT) but running fine on other devices
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM