flutter_webview_plugin throws error while generating .apk file
I want to generate .apk file for my application.But it is not able to do so because of AndroidX incompatibility for flutter_webview_plugin.I tried everything as per https://flutter.dev/docs/development/androidx-migration ,still nothing is helping:
This is the error I am getting when I run:
C:\flutter\flutter\flutter\bin\flutter.bat --no-color build apk
You are building a fat APK that includes binaries for android-arm, android-arm64, android-x64.
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,android-x64
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,android-x64 --split-per-abi
Learn more on: https://developer.android.com/studio/build/configure-apk-splits#configure-abi-split
Running Gradle task 'assembleRelease'...
Removed unused resources: Binary resource data reduced from 517KB to 502KB: Removed 2%
Running Gradle task 'assembleRelease'... 618.1s (!)
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 android_alarm_manager...
Running Gradle task 'assembleAarRelease'...
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
- What went wrong: Execution failed for task ':launch_review:verifyReleaseResources'.
A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade Android resource linking failed C:\Users\w8.gradle\caches\transforms-2\files-2.1\0a271e99b6771ad4a84318244d532fb7\core-1.0.0\res\values\values.xml:57:5-88:25: AAPT: error: resource android:attr/fontVariationSettings not found.
C:\Users\w8\.gradle\caches\transforms-2\files-2.1\0a271e99b6771ad4a84318244d532fb7\core-1.0.0\res\values\values.xml:57:5-88: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. ==============================================================================
2: Task failed with an exception.
- What went wrong: Execution failed for task ':screen_state:verifyReleaseResources'.
A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade Android resource linking failed C:\Users\w8.gradle\caches\transforms-2\files-2.1\0a271e99b6771ad4a84318244d532fb7\core-1.0.0\res\values\values.xml:57:5-88:25: AAPT: error: resource android:attr/fontVariationSettings not found.
C:\Users\w8\.gradle\caches\transforms-2\files-2.1\0a271e99b6771ad4a84318244d532fb7\core-1.0.0\res\values\values.xml:57:5-88: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 10m 8s
42.9s
√ Built build\app\outputs\repo.
Building plugin android_intent...
Running Gradle task 'assembleAarRelease'... 10.7s
√ Built build\app\outputs\repo.
Building plugin flutter_webview_plugin...
Running Gradle task 'assembleAarRelease'...
The plugin flutter_webview_plugin could not be built due to the issue above.
Process finished with exit code 1
same