Error while executing: am start -n "" -a android.intent.action.MAIN -c android.intent.category.LAUNC

来源:互联网 发布:linux安装hba卡驱动 编辑:程序博客网 时间:2024/06/18 10:28
Error while executing: am start -n 
"package_name/package_name.MainActivity"
-a android.intent.action.MAIN -c android.intent.category.LAUNC
修改配置文件而没有修改代码的情况下,AndroidStudio默认为代码没有改变,因此没有重新安装APK。可能是由于AS的Instant Run功能异常导致。可以在代码中加上一个回车或者几个空格试试。
如果不行,解决办法如下:
修改代码之后,点击运行,AndroidStudio没有进行重新编译,而是提示no changes to deploy,然后启动修改前的那个APP,代码修改完全没用。这个问题初步判断是由于AndroidStudio的Instant run功能出错导致的。目前只能在settings->Build,Execution,Deployment->Instant Run中将Enable Instant Run to hot swap code/resource changes on deploy选项的勾点掉。这是默认启用的。点掉之后就正常了,每次点击运行都会重新安装APP。
阅读全文
0 0
原创粉丝点击