Android Studio运行报错Error while executing: am start -n

报错详情

08/19 09:54:18: Launching app
$ adb install-multiple -r -t D:\work\self\CallAutoRecord\app\build\intermediates\split-apk\debug\slices\slice_4.apk D:\work\self\CallAutoRecord\app\build\intermediates\split-apk\debug\slices\slice_9.apk D:\work\self\CallAutoRecord\app\build\intermediates\split-apk\debug\slices\slice_3.apk D:\work\self\CallAutoRecord\app\build\intermediates\split-apk\debug\slices\slice_8.apk D:\work\self\CallAutoRecord\app\build\intermediates\split-apk\debug\slices\slice_6.apk D:\work\self\CallAutoRecord\app\build\intermediates\split-apk\debug\slices\slice_5.apk D:\work\self\CallAutoRecord\app\build\intermediates\split-apk\debug\dep\dependencies.apk D:\work\self\CallAutoRecord\app\build\intermediates\split-apk\debug\slices\slice_7.apk D:\work\self\CallAutoRecord\app\build\intermediates\split-apk\debug\slices\slice_2.apk D:\work\self\CallAutoRecord\app\build\intermediates\split-apk\debug\slices\slice_1.apk D:\work\self\CallAutoRecord\app\build\intermediates\resources\instant-run\debug\resources-debug.apk D:\work\self\CallAutoRecord\app\build\intermediates\split-apk\debug\slices\slice_0.apk D:\work\self\CallAutoRecord\app\build\intermediates\instant-run-apk\debug\app-debug.apk 
Split APKs installed in 10 s 564 ms
$ adb shell am start -n "com.guoqi.callautorecord/com.guoqi.callautorecord.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -D
Error while executing: am start -n "com.guoqi.callautorecord/com.guoqi.callautorecord.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -D
Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.guoqi.callautorecord/.MainActivity }
Error type 3
Error: Activity class {com.guoqi.callautorecord/com.guoqi.callautorecord.MainActivity} does not exist.

Error while Launching activity

在这里插入图片描述

问题原因

  • 手机系统BUG没有将APP卸载干净,导致安装失败运行不起来。

解决方案

  • 先到sdk\platform-tools路径找到adb命令
    在这里插入图片描述

  • 然后在当前目录,打开命令行窗口,输入adb devices

在这里插入图片描述

  • 确认手机已连上,然后用adb卸载,输入命令,adb uninstall com.guoqi.callautorecordcom.guoqi.callautorecord是我自己的包名,要换成自己的哦)
    在这里插入图片描述

  • 再安装就成功了,如下图所示。
    在这里插入图片描述

posted on 2021-08-19 10:08  愤怒的苹果ext  阅读(861)  评论(0编辑  收藏  举报

导航