简体   繁体   English

Android App在Api 21和23中运行良好,但在19中具有RuntimeException?

[英]Android App works well in Api 21 & 23 but RuntimeException in 19?

I have an app with minimum sdk - 14 and target sdk - 23 . 我有一个minimum sdk - 14target sdk - 23的应用程序。
My app works well on API 21 & 23 but facing an RuntimeException on 19 . 我的应用程序在API 2123上运行良好,但在19上面临RuntimeException This is the error- 这是错误-

java.lang.RuntimeException: Unable to instantiateapplication 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/com.blogspot.appsjango.App-1.apk"],nativeLibraryDirectories=[/data/app-l
ib/com.appsjango.App-1, /system/lib, /system/lib/arm]]   

I have seen some answers for similar questions answering disable instant run but app is in apk and runs in some devices. 我已经看到了类似问题的一些答案,这些答案回答了禁用instant run但应用程序在apk中并且在某些设备中运行。 So it is not an actual solution. 因此,这不是一个实际的解决方案。

As CommonsWare says the Instant run makes the problem. 正如CommonsWare所说的,即时运行会造成问题。
When i turn off the instant run it runs fine. 当我关闭即时运行时,它运行正常。
I also notify that the size of App reduce when the Instant Run turned off. 我还通知说,关闭“即时运行”后,应用程序的大小会减小。

Instant Run need to add some files related to the API when building the apk. 在构建apk时,Instant Run需要添加一些与API相关的文件。 So, if you need to build the app with Instant Run turn on, you must provided the related API SDK. 因此,如果您需要在启用Instant Run的情况下构建应用程序,则必须提供相关的API SDK。

For example, if you want the app run in API Level 19, then you need to download API Level 19 to your Android SDK. 例如,如果要使该应用程序在API级别19中运行,则需要将API级别19下载到Android SDK。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Android 6.0 Marshmallow-服务未在API 23上开始测试,在API 21上正常运行 - Android 6.0 Marshmallow - Service not starting on test with API 23, works fine on API 21 Android appcompat v21不起作用,但v23起作用 - Android appcompat v21 not work but v23 works 在 android 版本 5 和 6(android api 21 和 23)中崩溃 ExoPlayer.Builder - Crash ExoPlayer.Builder in android version 5 and 6 (android api 21 and 23) 进度条适用于Android API 23,但不适用于21或22 - Progress bar working on Android API 23, but not 21 or 22 setbackgrounddrawable 在 android API 23 中不起作用 - setbackgrounddrawable dont works in android API 23 迁移到android studio后,Android主题不适用于API v19(但适用于API v21) - Android theme not applied on API v19 after migration to android studio (but is applied on API v21) 应用程序适用于API 26但在API 23(marshmallow)上崩溃 - App works on API 26 but crashes on API 23 (marshmallow) 仅适用于java.runtimeException api 19至15 - java.runtimeException only api 19 to 15 HttpsURLConnection不适用于Android API 19(但适用于API 22至29) - HttpsURLConnection not working on Android API 19 (but works on API 22 through 29) OnOptionsItemSelected不适用于Android API 19(但适用于android 24) - OnOptionsItemSelected doesn't work on android API 19 (but works on android 24)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM