首页 > 解决方案 > Android Studio 无需安装应用即可运行我的应用

问题描述

我正在尝试使用 Android studio 3.6.3 和我的手机制作一个应用程序来测试它。我遇到了一个问题,我认为卸载该应用程序是个好主意,但现在,Android Studio 无法识别该应用程序在我的手机上不存在,它会尝试运行该MainActivity.class文件。错误是:

05/27 21:03:30:在小米红米 Note 7 上启动“MainActivity”。

$ adb shell am start -n "com.example.liteshop20/com.example.liteshop20.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER 执行时出错:am start -n "com .example.liteshop20/com.example.liteshop20.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER 开始: Intent { act=android.intent.action.MAIN cat=[android.intent .category.LAUNCHER] cmp=com.example.liteshop20/.MainActivity } 错误类型 3 错误:活动类 {com.example.liteshop20/com.example.liteshop20.MainActivity} 不存在。

启动活动时出错

我怎样才能欺骗它以正确重新安装应用程序?

标签: android-studio

解决方案


我在右侧解决了它 Grandle>MyApp>Tasks>install>UninstallRelease ,然后再次运行应用程序以便它正确构建。


推荐阅读