Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

build flutter com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed

yesterday, I upgraded flutter to the latest version(1.12.13+hotfix.5),i got the following errors when building the flutter apk

* What went wrong:                                                                                                 
Execution failed for task ':sharesdk_plugin:verifyReleaseResources'.                                               
> java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed
  /Users/binaryiv/Documents/projects/appProjects/huoli/app/build/sharesdk_plugin/intermediates/res/merged/release/values/values.xml:879: error: resource android:attr/fontVariationSettings not found.
  /Users/binaryiv/Documents/projects/appProjects/huoli/app/build/sharesdk_plugin/intermediates/res/merged/release/values/values.xml:880: error: resource android:attr/ttcIndex not found.
  error: failed linking references. 

my compileSdkVersion and targetSdkVersion is 28,i can build it by deleting the sharesdk_plugin plugin. Is there any other way to configure and keep the plugin by building

like image 289
thomas Avatar asked Dec 13 '19 04:12

thomas


Video Answer


1 Answers

I found in the error: resource android:attr/fontVariationSettings not found last answer can solved my problems with sharesdk_plugin Add the code:

subprojects {
    afterEvaluate {project ->
        if (project.hasProperty("android")) {
            android {
                compileSdkVersion 28
                buildToolsVersion '29.0.2'
            }
        }
    }
}

in android/build.gradle in the last. Good luck for you.

like image 153
general_id Avatar answered Nov 14 '22 22:11

general_id