Flutter应用程序在Android 12中不起作用。给我错误install_parse_failed_manifest_malformed
Flutter App在Android 12中没有工作。我尝试了各种事情,例如添加exported =“ true”
,但我仍然无法在Android 12上运行该应用。
错误:错误:
adb: failed to install D: \Flutter BLE May 2022\ SW_Mobile_Platform\ build\ app\ outputs\ flutter - apk\ app.apk: Failure[INSTALL_PARSE_FAILED_MANIFEST_MALFORMED: Failed parse during installPackageLI: /data/app / vmdl1121899374.tmp / base.apk(at Binary XML file line #184): org.altbeacon.beacon.startup.StartupBroadcastReceiver: Targeting S+ (version 31 and above) requires that an explicit value for
android:exported be defined when intent filters are present]
这是我的清单
文件:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.ble_app_flutter">
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
<uses-permission android:name="android.permission.BLUETOOTH_SCAN" />
<uses-permission android:name="android.permission.BLUETOOTH_SCAN" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.BLUETOOTH_ADVERTISE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
<uses-feature
android:name="android.hardware.bluetooth.le"
android:required="true" />
<application
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher"
android:label="ble_app_flutter"
android:usesCleartextTraffic="true">
<activity
android:name=".BLEActivity"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:exported="true"
android:hardwareAccelerated="true"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:windowSoftInputMode="adjustResize">
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. -->
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme" />
<meta-data
android:name="io.flutter.embedding.android.SplashScreenDrawable"
android:resource="@drawable/launch_background" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data
android:name="flutterEmbedding"
android:value="2" />
</application>
</manifest>
Flutter app is not working in Android 12. I have tried various things like adding exported="true"
but still i am not able to run the app on Android 12.
Error:
adb: failed to install D: \Flutter BLE May 2022\ SW_Mobile_Platform\ build\ app\ outputs\ flutter - apk\ app.apk: Failure[INSTALL_PARSE_FAILED_MANIFEST_MALFORMED: Failed parse during installPackageLI: /data/app / vmdl1121899374.tmp / base.apk(at Binary XML file line #184): org.altbeacon.beacon.startup.StartupBroadcastReceiver: Targeting S+ (version 31 and above) requires that an explicit value for
android:exported be defined when intent filters are present]
Here is my Manifest
file:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.ble_app_flutter">
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
<uses-permission android:name="android.permission.BLUETOOTH_SCAN" />
<uses-permission android:name="android.permission.BLUETOOTH_SCAN" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.BLUETOOTH_ADVERTISE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
<uses-feature
android:name="android.hardware.bluetooth.le"
android:required="true" />
<application
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher"
android:label="ble_app_flutter"
android:usesCleartextTraffic="true">
<activity
android:name=".BLEActivity"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:exported="true"
android:hardwareAccelerated="true"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:windowSoftInputMode="adjustResize">
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. -->
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme" />
<meta-data
android:name="io.flutter.embedding.android.SplashScreenDrawable"
android:resource="@drawable/launch_background" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data
android:name="flutterEmbedding"
android:value="2" />
</application>
</manifest>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
转到AndroidManifest文件(your_project_folder-&gt; android-&gt; src-&gt; src-&gt; main--&gt; androidmanifest.xml):
只需添加
android:exported = exported =“ exported =” true code>“ true”
“ true” 。检查以下内容:Go to AndroidManifest file (your_project_folder->android->app->src->main->AndroidManifest.xml):
Just add
android:exported="true"
inside your activity tag. Check the following: