I've been trying to create an apk of my app, using flutter build apk --release
in cmd, but I get this error every time I run this command:
FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':unique_identifier: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 C:\Users\.gradle\caches\transforms-2\files-2.1\71871fd20009e8811e4cb86c0e32da7a\core-1.1.0\res\values\values.xml:142:5-173:25: AAPT: error: resource android:attr/fontVariationSettings not found. C:\Users\.gradle\caches\transforms-2\files-2.1\71871fd20009e8811e4cb86c0e32da7a\core-1.1.0\res\values\values.xml:142:5-173:25: AAPT: error: resource android:attr/ttcIndex not found.
BUILD FAILED in 4m 26s Running Gradle task 'assembleRelease'... Running Gradle task 'assembleRelease'... Done 267,5s The build failed likely due to AndroidX incompatibilities in a plugin. The tool is about to try using Jetifier to solve the incompatibility. Building plugin device_info... The plugin device_info could not be built due to the issue above. Running Gradle task 'assembleAarRelease'... /
Flutter doctor:
[√] Flutter (Channel stable, 2.2.1, on Microsoft Windows [versão 10.0.19041.985], locale pt-BR)
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[√] Chrome - develop for the web
[√] Android Studio (version 4.0)
[√] VS Code (version 1.56.2)
[√] Connected device (3 available)