5

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

thomas
  • 51
  • 1
  • 2

3 Answers3

4

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.

Kishan Bharda
  • 5,446
  • 3
  • 30
  • 57
general_id
  • 41
  • 1
  • i was able to fix such an issue by just doing the change for a specific project `...if (project.name == "plugin_that_has_the_issue") { android { .... } }` – Bernhard Jul 01 '20 at 13:03
2

go to the file:

~/flutter/.pub-cache/hosted/pub.dartlang.org/sharesdk_plugin-1.2.1/android/build.gradle

and change all compileSdkVersion to:

compileSdkVersion 28

ps: There may be more than 1 compileSdkVersion in build.gradle.

1

I also had same issue but the plugin was different. Firstly remove cache i.e Invalidate cache/restart then, add: android.enableAapt2=false in gradle.properties.

Shikarin
  • 11
  • 3