更新到Android Studio 2.3.3 之后发生的,在发生这个错误后再次尝试运行,又会成功运行。
错误信息:
$ adb install-multiple -r D:\AndroidStudioProjects\MyApp2\app\build\intermediates\split-apk\debug\dep\dependencies.apk D:\AndroidStudioProjects\MyApp2\app\build\intermediates\split-apk\debug\slices\slice_1.apk D:\AndroidStudioProjects\MyApp2\app\build\intermediates\split-apk\debug\slices\slice_2.apk D:\AndroidStudioProjects\MyApp2\app\build\intermediates\split-apk\debug\slices\slice_0.apk D:\AndroidStudioProjects\MyApp2\app\build\intermediates\split-apk\debug\slices\slice_3.apk D:\AndroidStudioProjects\MyApp2\app\build\intermediates\split-apk\debug\slices\slice_4.apk D:\AndroidStudioProjects\MyApp2\app\build\intermediates\split-apk\debug\slices\slice_7.apk D:\AndroidStudioProjects\MyApp2\app\build\intermediates\split-apk\debug\slices\slice_6.apk D:\AndroidStudioProjects\MyApp2\app\build\intermediates\split-apk\debug\slices\slice_5.apk D:\AndroidStudioProjects\MyApp2\app\build\intermediates\split-apk\debug\slices\slice_8.apk D:\AndroidStudioProjects\MyApp2\app\build\intermediates\split-apk\debug\slices\slice_9.apk D:\AndroidStudioProjects\MyApp2\app\build\outputs\apk\app-debug.apk
Split APKs installed
$ adb shell am start -n "com.diudiu.myapp2/com.diudiu.myapp2.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Unexpected error while executing: am start -n "com.diudiu.myapp2/com.diudiu.myapp2.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Error while Launching activity
解决方法:clean一下project即可;
说明:也有人提供解决方案:是调试的手机上有软件拦截我正在调试的应用安装,报错也是这个,取消拦截后正常调试。