简体   繁体   中英

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.

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:

  1. Open Your Project's Android manifest, located at android/app/src/main/AndroidManifest.xml

  2. Go to this line: android:name=".MainActivity"

  3. Below this line, add 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. 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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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