繁体   English   中英

“运行 com.example.flutter_launcher 时出错。未找到默认活动”更改 AndroidManifest 后

[英]"Error running com.example.flutter_launcher. Default activity not found" after changing AndroidManifest

我在 AndroidManifest 中添加了这两行。

<category android:name="android.intent.action.DEFAULT" />
<category android:name="android.intent.action.HOME" />

现在我收到此错误,即使在恢复更改后也是如此。

Error running com.example.flutter_launcher. Default activity not found
Unable to read manifest info from D:\src\flutter_launcher\build\app\outputs\apk\app.apk.
No application found for TargetPlatform.android_x86.
Is your project missing an android\app\src\main\AndroidManifest.xml?
Consider running "flutter create ." to create one.

我运行了“flutter create”。 没有运气。

删除D:\\src\\flutter_launcher\\build\\app\\outputs\\apk\\app.apk对我D:\\src\\flutter_launcher\\build\\app\\outputs\\apk\\app.apk

看起来 Android Studio 检测到它丢失并重建它。 这个问题很可能是因为您打开了第二个 Android Studio 与 Android 平台进行平台集成,并且 Flutter Android Studio 没有检测到清单更改并且没有重建 APK。

我用以下方法解决了这个问题:

  1. flutter 清洁
  2. flutter 酒吧得到

我使用上述解决方案仍然遇到未找到manifest或默认活动的问题,然后我删除了已添加到清单中的代码,并单独打开 android 文件夹并在其中进行更改并从那里运行应用程序。 有效。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM