Error while executing: am start -n(更换包名)

更改包名后运行App,App可以安装但无法启动Launch Activity具体信息如下:

Error while executing: am start -n "my.test.app/com.seal.main.activity.SplashActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER

Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=my.test.app/com.seal.main.activity.SplashActivity }

Error type 3

Error: Activity class {my.test.app/com.seal.main.activity.SplashActivity} does not exist.

原因

    根据错误信息来看,Android studio仍然启动的是上个包名下的Activity,也就说明Android studio缓存了启动信息,我们需要清除它。

注意:如果你是华为手机,也有可能是隐私空间造成的该问题,两个空间都安装了app,这里特别感谢本文评论中提出该问题的朋友

解决方案

    找到File-> Invalidate Caches / Restart ,重启Android Studio,重启完成后运行APP就可以正常启动了.


 

猜你喜欢

转载自blog.csdn.net/guochengabcd/article/details/105433343
今日推荐