在为 Google Play 商店生成 .aab 文件的过程中,我尝试运行以下命令作为该过程的一部分:
aapt2.exe link --proto-format -o base.zip -I android.jar --manifest decompile_apk\AndroidManifest.xml
在处理结束时我收到这些错误:
decompile_apk\AndroidManifest.xml:3: error: resource mipmap/launcher_icon (aka com.xyz.dbdb:mipmap/launcher_icon) not found.
decompile_apk\AndroidManifest.xml:4: error: resource style/LaunchTheme (aka com.xyz.dbdb:style/LaunchTheme) not found.
decompile_apk\AndroidManifest.xml:5: error: resource style/NormalTheme (aka com.xyz.dbdb:style/NormalTheme) not found.
error: failed processing manifest.
我拥有的文件如下
D:\myproject\android\app\src\main\res\drawable\launch_background.xml
D:\myproject\android\app\src\main\res\drawable-v21\launch_background.xml
D:\myproject\android\app\src\main\res\mipmap-hdpi\launcher_icon.png
D:\myproject\android\app\src\main\res\mipmap-mdpi\launcher_icon.png
D:\myproject\android\app\src\main\res\mipmap-xhdpi\launcher_icon.png
D:\myproject\android\app\src\main\res\mipmap-xxhdpi\launcher_icon.png
D:\myproject\android\app\src\main\res\mipmap-xxxhdpi\launcher_icon.png
D:\myproject\android\app\src\main\res\values\styles.xml
D:\myproject\android\app\src\main\res\values-night\styles.xml
我的AndroidManifest.xml如下:
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application
android:label="DBDB"
android:name="${applicationName}"
android:icon="@mipmap/launcher_icon">
<activity
android:name=".MainActivity"
android:exported="true"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
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"
/>
<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>
<uses-permission android:name="android.permission.INTERNET"/>
</manifest>
如何解决这些问题的任何线索:
在与各种选项进行了大量争论并且没有收到任何答案之后,我将我的项目从 Visual Code 转移到了 Android Studio。在那里重新编译项目。签署AAB并成功上传到Google Play商店。