AndroidStudio报错:Error while executing: am start

编程入门 行业动态 更新时间:2024-10-15 08:25:59

AndroidStudio<a href=https://www.elefans.com/category/jswz/34/1771188.html style=报错:Error while executing: am start"/>

AndroidStudio报错:Error while executing: am start

报错如下:

Error while executing: am start -n 
"com.shuyu.money/com.shuyu.money.ui.splash.SplashActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.shuyu.money/com.shuyu.money.ui.splash.SplashActivity }
Error type 3
Error: Activity class {com.shuyu.money/com.shuyu.money.ui.splash.SplashActivity} does not exist.

每个人的情况都不一样,建议下面的方法一一试过去
方法一:卸载手机中的这个App(需要卸载干净,比如华为手机有一个隐私空间,里面的也要卸载)
方法二:clean工程,重新build
方法三:Invalidate and Restart
方法四:重复开关手机的开发者模式与重复拔插数据线
运气好的话,一般这样都会解决,如果还是不行,那就继续百度吧

其实,我遇到这个问题很多次了,有一次是因为我更改了包名。

原因:
从报错信息来看,AS启动的仍然是上个包名的Activity,也就说明AS缓存了启动信息,所以需要清除它。
解决方案:
找到File-> Invalidate Caches / Restart ,然后重启Android Studio,重启完成后运行APP就可以正常启动了。

更多推荐

AndroidStudio报错:Error while executing: am start

本文发布于:2024-03-05 07:06:34,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1711636.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:报错   AndroidStudio   Error   start   executing

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!