![]()
这个错误产生于近期由于实际需要,从ecplise+adt换成了android studio。在更换之前,是完全可以通过export CLASSPATH=/data/app/com.example.lenovo.screenshot2-1/base.apk exec app_process /system/bin com.example.lenovo.screenshot2.Main1 '$@' 去调用main1类中的main方法的,但是更换之后却一直报错,断断续续寻找了一段时间,终于找到原因:
![]()
至于具体原因,外国友人做出了说明
http://stackoverflow.com/questions/33967703/unable-to-instantiate-application-com-android-tools-fd-runtime-bootstrapapplicat
原文:
|
Disable the Instant Run option in Android Studio. Instructions are in the Android Studio Instant Run documentation.
Instant Run tries to do hot swapping of your code; this causes the application class to be moved.
To disable Instant Run Go to File --> Settings--> Build,Execution,Deployment -->Instant Run ---> uncheck "Enable instant run"
|
这名仁兄说了 instant Run 会对你代码使用热交换,这会导致应用中的class被移动位置。
详情见官网文档
https://developer.android.com/studio/run/index.html#instant-run