我正在尝试构建apk,但是firebase admob出现了问题,我确实尝试使用Flutter构建appbundle来生成.aab文件,这是否意味着我有一些AndroidX兼容性问题?还是有其他问题?如果我在不使用firebase_admob的情况下运行,那么apk可以完美地运行并且没有任何错误如何解决该问题? 虽然app-debug.apk安装正常,但我需要apk才能将其上传到Play商店。
我遇到此错误:
C:\Users\Waqas\AndroidStudioProjects\gtvsports1>Flutter build appbundle
Initializing gradle... 1.8s
Resolving dependencies... 4.6s
Running Gradle task 'bundleRelease'... 25.5s
Built build\app\outputs\bundle\release\app.aab (28.3MB).
C:\Users\Waqas\AndroidStudioProjects\gtvsports1>Flutter build apk
You are building a fat APK that includes binaries for android-arm, android-arm64.
If you are deploying the app to the Play Store, it's recommended to use app bundles or split the APK to reduce the APK size.
To generate an app bundle, run:
flutter build appbundle --target-platform android-arm,android-arm64
Learn more on: https://developer.android.com/guide/app-bundle
To split the APKs per ABI, run:
flutter build apk --target-platform android-arm,android-arm64 --split-per-abi
Learn more on: https://developer.android.com/studio/build/configure-apk-splits#configure-abi-split
Initializing gradle... 1.4s
Resolving dependencies... 5.5s
Running Gradle task 'assembleRelease'...
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':firebase_admob:verifyReleaseResources'.
> java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed
C:\Users\Waqas\AndroidStudioProjects\gtvsports1\build\firebase_admob\intermediates\res\merged\release\values\values.xml:304: error: resource android:attr/fontVariationSettings not foun
d.
C:\Users\Waqas\AndroidStudioProjects\gtvsports1\build\firebase_admob\intermediates\res\merged\release\values\values.xml:305: error: resource android:attr/ttcIndex not found.
error: failed linking references.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 17s
Running Gradle task 'assembleRelease'... 18.8s
Gradle task assembleRelease failed with exit code 1