I am facing a strange problem after I have updated flutter or android studio. I was able to run flutter build apk command before. But I can export ipa for iOS version of same application.
I have updated the latest versions of packages. Checked "compilesdkversion 28". Everything looks ok I think.
You can see my failed packages below.
Here is the error output;
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':keyboard_visibility:verifyReleaseResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Android resource linking failed
/Users/serkanerkan/.gradle/caches/transforms-2/files-2.1/a528b13ac93e64cafa3d0480e2c93207/core-1.1.0/res/values/values.xml:142:5-173:25: AAPT: error: resource android:attr/fontVariationSettings not found.
/Users/serkanerkan/.gradle/caches/transforms-2/files-2.1/a528b13ac93e64cafa3d0480e2c93207/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 16s
Running Gradle task 'assembleRelease'...
Running Gradle task 'assembleRelease'... Done 17.8s
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 connectivity...
Running Gradle task 'assembleAarRelease'...
Running Gradle task 'assembleAarRelease'... Done 1,391ms
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'connectivity'.
> SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.
* 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 1s
The plugin connectivity could not be built due to the issue above.
go to this folder-> C:\flutter.pub-cache\hosted\pub.dartlang.org\keyboard_visibility-0.5.6\android Open build.gradle change the compileSdkVersion 27 to compileSdkVersion 28 then flutter clean -> flutter pub get -> flutter build apk --release
I solved this by changing it in Android studio.
Inside project view,
"[project_folder]/external_package/flutter_plugin/[problem_causing_plugin_name]/android/build.gradle/"
Change compileSdkVersion 27 to compileSdkVersion 28 (or latest)
then, run Flutter clean and Flutter pub get, and
once again try to create release apk.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With