flutter app apk is giving clipboard_manager error

Issue

I am trying to build an apk of my flutter app, but when I run this command

flutter build apk

I encounter the following error;

FAILURE: Build failed with an exception.                                
                                                                        
* What went wrong:                                                      
Execution failed for task ':clipboard_manager:verifyReleaseResources'.  
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
   > Android resource linking failed                                    
     /home/username/.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.
                                                                        
     /home/username/.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 9s    
Running Gradle task 'assembleRelease'...                                
Running Gradle task 'assembleRelease'... Done                      10.1s
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 clipboard_manager...
Running Gradle task 'assembleAarRelease'...                             
Running Gradle task 'assembleAarRelease'... Done                   741ms


FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'clipboard_manager'.
> 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 0s


The plugin clipboard_manager could not be built due to the issue above.  

I am getting the flutter pub outdated --mode=null-safety

Package Name            Current   Upgradable  Resolvable  Latest    

direct dependencies:   
clipboard_manager       ✗0.0.4    ✗0.0.4      ✗0.0.4      ✗0.0.4    
cupertino_icons         ✗0.1.3    ✗0.1.3      ✓1.0.3      ✓1.0.3    
dio                     ✗3.0.10   ✗3.0.10     ✓4.0.0      ✓4.0.0    
flutter_circular_chart  ✗0.1.0    ✗0.1.0      ✗0.1.0      ✗0.1.0    
flutter_secure_storage  ✗3.3.5    ✗3.3.5      ✓4.2.0      ✓4.2.0    
flutter_svg             ✗0.19.3   ✗0.19.3     ✓0.22.0     ✓0.22.0   
http                    ✗0.12.2   ✗0.12.2     ✓0.13.3     ✓0.13.3   
image_picker            ✗0.6.5+3  ✗0.6.5+3    ✓0.8.0+3    ✓0.8.0+3  
logger                  ✗0.9.4    ✗0.9.4      ✓1.0.0      ✓1.0.0    
provider                ✗4.3.3    ✗4.3.3      ✓5.0.0      ✓5.0.0    

8  dependencies are constrained to versions that are older than a resolvable version.
To update these dependencies, edit pubspec.yaml, or run `flutter pub upgrade --null-safety`.                     

I have searched for it, and they told to change the flutter.sdk, to home.username/Android/Sdk I did this, but after running the buiuld command I got home/lechat/snap/flutter/common/flutter in flutter.sdk in local.properties.
I do not know what the problem actually is. Kindly halp me with this problem. If you any other information I am ready to share it.
I have also followed this question, related problem
but still getting the same error.

Solution

Check this similar question there are multiple answers and all of them seem to get the work done, only one of them uses clipboard_manager though.

Answered By – Jaime Ortiz

Answer Checked By – Timothy Miller (FlutterFixes Admin)

Leave a Reply

Your email address will not be published. Required fields are marked *