继续浏览精彩内容
慕课网APP
程序员的梦工厂
打开
继续
感谢您的支持,我会继续努力的
赞赏金额会直接到老师账户
将二维码发送给自己后长按识别
微信支付
支付宝支付

Unable to instantiate activity ComponentInfo

一只名叫tom的猫
关注TA
已关注
手记 346
粉丝 62
获赞 329

错误描述:

今天做了一个关于传感器的demo,任何地方都没有出错,但是运行安装到真机的apk居然老是闪退

报:Unable to instantiate activity ComponentInfo   Didn't find class " " on path: DexPathList 

过程:

用百度和谷歌搜了老半天,试了好多说实话对我遇到的错误没有任何意义;又看了一编logcat,同时我发现EventLog里面有句和重要的话 Instant Run detected that you are running on a target device that has a work profile or multiple user accounts.Launching the app under a work profile or another user account on the target device will result in a crash.Learn more about how to run your app under a work profile. 这句话的实际意义就是:正在运行具有工作配置文件或多个用户帐户的目标设备。在工作配置文件或目标设备上的另一个用户帐户下启动应用程序将导致崩溃。了解有关如何在工作配置文件下运行应用程序的更多信息。看到这句话也就明白意思了,也就是说我运行配置有问题,那我就找studio找到安装运行配置进行设置

解决:

Settings>Build Execution Deplayment>Instant Run把对勾点掉保存,然后Clean一下项目运行

原文链接:http://www.apkbus.com/blog-784586-78028.html


打开App,阅读手记
0人推荐
发表评论
随时随地看视频慕课网APP