【发布时间】:2025-12-26 20:25:06
【问题描述】:
我正在克隆 Repo 并面临这个问题
因为我在 macbook air M1 中使用 android 模拟器
我的 AndroidMenifest.xml 如下
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.abc.gc">
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
<application
android:label="Green Co"
android:allowBackup="false"
android:fullBackupOnly="false"
android:icon="@mipmap/ic_launcher">
<meta-data android:name="com.google.android.geo.API_KEY"
android:value="-----------------------------"/>
<meta-data
android:name="com.google.firebase.messaging.default_notification_channel_id"
android:value="@string/default_notification_channel_id" />
<meta-data
android:name="com.google.firebase.messaging.default_notification_icon"
android:resource="@mipmap/ic_launcher" />
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:screenOrientation="portrait"
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"
/>
<!-- Displays an Android View that continues showing the launch screen
Drawable until Flutter paints its first frame, then this splash
screen fades out. A splash screen is useful to avoid any visual
gap between the end of Android's launch screen and the painting of
Flutter's first frame. -->
<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>
<intent-filter>
<action android:name="FLUTTER_NOTIFICATION_CLICK" />
<category android:name="android.intent.category.DEFAULT" />
</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" />
<!-- Add your Google Maps API Key here -->
<meta-data android:name="com.google.android.geo.API_KEY"
android:value="----------------------------"/>
</application>
</manifest>
我面临错误
错误:ADB 以退出代码 1 退出正在执行流式安装
adb: 安装失败 /Users/gajanan/Ampra/flutter/greencorridor_package/build/app/outputs/flutter-apk/app.apk: 失败 [INSTALL_PARSE_FAILED_MANIFEST_MALFORMED: 期间解析失败 installPackageLI:/data/app/vmdl760273936.tmp/base.apk(在二进制 XML 文件第 64 行):com.ampra.greencorridor.MainActivity:定位 S+ (版本 31 及更高版本)要求为 android:在存在意图过滤器时定义导出]错误 在 sdk gphone64 arm64 上启动应用程序。
希望能找到解决办法 如果有人帮我找到解决方案,那真的很重要!!!
【问题讨论】:
-
这能回答你的问题吗? Manifest merger failed targeting Android 12
标签: android flutter flutter-dependencies