Android:adb通过app_process调用java类报错-java.lang.ClassNotFoundException

这个错误产生于近期由于实际需要,从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

原文:


down vote accepted

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

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值