我正在嘗試使用構建應用程式,flutter build apk --release但它拋出以下錯誤。代碼在除錯模式下運行,但不知道為什么它不在--release模式下構建
* What went wrong:
Execution failed for task ':app:processReleaseResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Android resource linking failed
/build/app/intermediates/packaged_manifests/release/AndroidManifest.xml:16: AAPT: error: unexpected element <appliation> found in <manifest>.
這是我的AndroidManifest.xml配置。
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.test">
<appliation
android:label="Test"
android:name="${applicationName}"
android:icon="@mipmap/launcher_icon">
<activity
android:name=".MainActivity"
android:exported="true"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme">
<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>
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="" />
<meta-data
android:name="flutterEmbedding"
android:value="2" />
</appliation>
</manifest>
和包,我使用的是:-
another_flushbar: ^1.10.28
cloud_firestore: ^3.1.5
cupertino_icons: ^1.0.2
firebase_auth: ^3.3.4
firebase_core: ^1.10.6
flutter:
sdk: flutter
flutter_launcher_icons: ^0.9.2
flutter_otp_text_field: ^1.0.0
geocoding: 2.0.1
geolocator: 8.0.1
google_fonts: ^2.1.0
google_maps_flutter: ^2.1.1
provider: ^6.0.1
感謝您的幫助!
uj5u.com熱心網友回復:
我用谷歌搜索了這個問題并嘗試了很多方法,但無法解決錯誤。android 部分的某些配置導致了錯誤,不知道那是什么,所以我決定洗掉android目錄并重新生成flutter create .并能夠解決給定的錯誤。
我遵循的步驟來解決
rm -rf android/ # remove android directory
flutter create . # generate fresh new android directory
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/393369.html
