Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter Build APK: Failed - Execution failed for task ':keyboard_visibility:verifyReleaseResources'

Tags:

flutter

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.

  • keyboard_visibility
  • connectivity

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.
like image 369
sashatheitguy Avatar asked Sep 18 '25 14:09

sashatheitguy


2 Answers

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

like image 183
Jithin Narayanan Avatar answered Sep 20 '25 10:09

Jithin Narayanan


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.

like image 42
Nachiket Gohil Avatar answered Sep 20 '25 09:09

Nachiket Gohil