[英]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 - 14
和target sdk - 23
的应用程序。
My app works well on API
21
& 23
but facing an RuntimeException
on 19
. 我的应用程序在
API
21
和23
上运行良好,但在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.