简体   繁体   English

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

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

Error:错误:

adb: failed to install C:\Users\legion\Desktop\nojoum-application\build\app\outputs\flutter-apk\app.apk: Failure [INSTALL_PARSE_FAILED_MANIFEST_MALFORMED: Failed parse during 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. 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。

This is my error log:这是我的错误日志:

这是我的错误日志

Please add the请添加

android:exported="true"

to your Main Activity's activity tag in the AndroidManifest.xml file, like this:AndroidManifest.xml文件中的 Main Activity 的activity标签,如下所示:

  1. Open Your Project's Android manifest, located at android/app/src/main/AndroidManifest.xml打开项目的 Android 清单,位于android/app/src/main/AndroidManifest.xml

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

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

The code should now look like this:代码现在应该如下所示:

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

Explanation解释

What this does is that it tells Android to make this activity available to be accessed by another app, so that it can open your App.它的作用是告诉 Android 使此活动可供另一个应用程序访问,以便它可以打开您的应用程序。 As the launcher (the app drawer/home screen) can be a normal app in android, the Main Activity must be exported to allow it to launch your app.由于启动器(应用程序抽屉/主屏幕)可以是 android 中的普通应用程序,因此必须导出 Main Activity 才能启动您的应用程序。

Go to android/app/src/main/AndroidManifest.xml and paste android:exported="true" after android:name=".MainActivity" like this: 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.

相关问题 我在安装 flutter 时遇到问题 - I have a problem when I was installing flutter 当我运行代码 gradle 任务需要太长时间时,我的 flutter 应用程序出现问题 我尝试了 flutter 医生,它说一切都正确,然后错误 - i have problem with my flutter app when i run the code gradle task takes too long i tried flutter doctor ,it says that all things is right ,then error 在构建我的Android应用程序时,我遇到了Fabric和crashlytics的问题 - I have a problem with fabric and crashlytics when building my Android App 我想自定义 Kotlin 中的新按钮时遇到问题 - I have a problem when I want to customize my new button in Kotlin 我有一个构建我的颤振应用程序的道具 - I have a prop with building my flutter app 我想在flutter应用程序中添加字体,但pubspec.yaml中有问题 - i want to add fonts in flutter app, but there is a problem in pubspec.yaml 当我尝试访问 Flutter 中的图像/资产时遇到问题 - I have a problem when i try to access the image /assets in Flutter 在Android上运行应用程序时出现问题 - I have a problem when running the app on android 当我想运行我的颤振/飞镖应用程序时,它给了我很多错误 - when i want to run my flutter/dart app it give me tons of error 我对 Flutter 上的空格有疑问 - I have a problem with the spaces on Flutter
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM