I'm building multiple apks for my flutter project. what I do:
// Add these config to android/app/build.gradle
android {
.
.
.
splits {
abi {
enable true
reset()
include "armeabi-v7a", "arm64-v8a"
universalApk true
}
}
}
Then, run commond line in terminal:
~/Path/project/ $ flutter build apk
but the error occurred:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:mpProcessReleaseManifest'.
> java.io.FileNotFoundException: /Users/user/Path/project/android/app/build/intermediates/merged_manifests/release/AndroidManifest.xml (No such file or directory)
* 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 8m 57s
my flutter doctor:
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.8.1, on macOS 12.0.1 21A559 darwin-x64, locale en-CN)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.1)
[✓] VS Code (version 1.62.3)
[✓] Connected device (1 available)
• No issues found!
What I tried:
I create a new sample flutter project to test, it's successed.
I compared the AndroidManifest.xml path to test project, I find that in the test project, this file's path is:
/project_test/build/app/intermediates/merged_manifests/release/universal/AndroidManifest.xml
/project_test/build/app/intermediates/merged_manifests/release/arm64-v8a/AndroidManifest.xml
/project_test/build/app/intermediates/merged_manifests/release/armeabi-v7a/AndroidManifest.xml
So I guess that the reason is gradle load this file from android directory but not build, but I don't how to resolve. Someone have same issue?
More info, hope to help: In project/android/build.gradle
dependencies {
classpath 'com.android.tools.build:gradle:4.2.0'
}