簡體   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