繁体   English   中英

当我想在 Flutter 中调试我的应用程序时遇到问题

[英]I have problem when I want debug my app in Flutter

错误:

adb: 无法安装 C:\Users\legion\Desktop\nojoum-application\build\app\outputs\flutter-apk\app.apk: 失败 [INSTALL_PARSE_FAILED_MANIFEST_MALFORMED: installPackageLI: /data/app/vmdl764320653.tmp. base.apk (at Binary XML file line #79): com.ryanheise.audioservice.AudioService: Targeting S+ (version 31 and above) requires that an explicit value for android:exported be defined when intent filters are present] Error launching application on sdk gphone64 x86 64。

这是我的错误日志:

这是我的错误日志

请添加

android:exported="true"

AndroidManifest.xml文件中的 Main Activity 的activity标签,如下所示:

  1. 打开项目的 Android 清单,位于android/app/src/main/AndroidManifest.xml

  2. Go 到这一行: android:name=".MainActivity"

  3. 在此行下方,添加android:exported="true"

代码现在应该如下所示:

android:name=".MainActivity" // this must be the main activity
android:exported="true"
android:launchMode="singleTop" // this line can be something else, no worries

解释

它的作用是告诉 Android 使此活动可供另一个应用程序访问,以便它可以打开您的应用程序。 由于启动器(应用程序抽屉/主屏幕)可以是 android 中的普通应用程序,因此必须导出 Main Activity 才能启动您的应用程序。

Go to android/app/src/main/AndroidManifest.xml and paste android:exported="true" after android:name=".MainActivity" like this: 在此处输入图像描述

暂无
暂无

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

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