I can build the debug app and it works perfectly. But when I try to build the release apk using flutter build apk --split-per-abi, the following error throws up.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':speech_recognition:verifyReleaseResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> 1 exception was raised by workers:
com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed
/home/abhayvashokan/.gradle/caches/transforms-2/files-2.1/805e05a71e209033ab91722f2d3217f8/core-1.1.0/res/values/values.xml:142:5-173:25: AAPT: error: resource android:attr/fontStyle not found.
/home/abhayvashokan/.gradle/caches/transforms-2/files-2.1/805e05a71e209033ab91722f2d3217f8/core-1.1.0/res/values/values.xml:142:5-173:25: AAPT: error: resource android:attr/font not found.
/home/abhayvashokan/.gradle/caches/transforms-2/files-2.1/805e05a71e209033ab91722f2d3217f8/core-1.1.0/res/values/values.xml:142:5-173:25: AAPT: error: resource android:attr/fontWeight not found.
/home/abhayvashokan/.gradle/caches/transforms-2/files-2.1/805e05a71e209033ab91722f2d3217f8/core-1.1.0/res/values/values.xml:142:5-173:25: AAPT: error: resource android:attr/fontVariationSettings not found.
/home/abhayvashokan/.gradle/caches/transforms-2/files-2.1/805e05a71e209033ab91722f2d3217f8/core-1.1.0/res/values/values.xml:142:5-173:25: AAPT: error: resource android:attr/ttcIndex not found.
* 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 42s
Running Gradle task 'assembleRelease'...
Running Gradle task 'assembleRelease'... Done 43.9s
The built failed likely due to AndroidX incompatibilities in a plugin. The tool is about to try using Jetfier to solve the incompatibility.
Building plugin permission_handler...
Running Gradle task 'assembleAarRelease'...
Running Gradle task 'assembleAarRelease'... Done 21.1s
FAILURE: Build failed with an exception.
* What went wrong:
Task 'assembleAarRelease' not found in root project 'permission_handler'.
* Try:
Run gradlew tasks to get a list of available tasks. 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 20s
The plugin permission_handler could not be built due to the issue above.
I have included the following version of speech_recognition in pubspec.yaml file.
speech_recognition: ^0.3.0+1
I am also attaching the flutter doctor output with --verbose.
[✓] Flutter (Channel master, 1.19.0-2.0.pre.143, on Linux, locale en_GB.UTF-8)
• Flutter version 1.19.0-2.0.pre.143 at /home/abhayvashokan/flutter
• Framework revision 9d58a87066 (6 days ago), 2020-05-22 22:37:01 -0700
• Engine revision 9ce1e5c5c7
• Dart version 2.9.0 (build 2.9.0-10.0.dev 7706afbcf5)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
• Android SDK at /home/abhayvashokan/Android/Sdk
• Platform android-29, build-tools 29.0.3
• Java binary at: /snap/android-studio/88/android-studio/jre/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
• All Android licenses accepted.
[✓] Chrome - develop for the web
• Chrome at google-chrome
[✓] Linux toolchain - develop for Linux desktop
• clang version 10.0.0-4ubuntu1
• cmake version 3.16.3
• ninja version 1.10.0
[✓] Android Studio (version 3.6)
• Android Studio at /snap/android-studio/88/android-studio
• Flutter plugin version 45.1.1
• Dart plugin version 192.8052
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
[✓] Connected device (4 available)
• Redmi Note 5 Pro • d1df6ad3 • android-arm64 • Android 9 (API 28)
• Linux • Linux • linux-x64 • Linux
• Web Server • web-server • web-javascript • Flutter Tools
• Chrome • chrome • web-javascript • Google Chrome 83.0.4103.61
• No issues found!
I can build the debug app and it works perfectly. But when I try to build the release apk using
flutter build apk --split-per-abi
, the following error throws up.I have included the following version of
speech_recognition
inpubspec.yaml
file.speech_recognition: ^0.3.0+1
I am also attaching the
flutter doctor
output with--verbose
.