[英]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
標簽,如下所示:
打開項目的 Android 清單,位於android/app/src/main/AndroidManifest.xml
Go 到這一行: android:name=".MainActivity"
在此行下方,添加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 才能啟動您的應用程序。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.