1
votes

I'm trying to build the release variant of my flutter app but i got this gradle error. Please help

FAILURE: Build failed with an exception.
* What went wrong: Execution failed for task ':location:verifyReleaseResources'.

java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed
/Users/omotayo/lasumonitor/build/location/intermediates/res/merged/release/values/values.xml:276: error: resource android:attr/fontVariationSettings not found.
/Users/omotayo/lasumonitor/build/location/intermediates/res/merged/release/values/values.xml:277: error: resource android:attr/ttcIndex not found. error: failed linking references.
* 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.

1

1 Answers

3
votes
  • In Android Studio (with your project open) right click the android folder, and click "Flutter"->"Open Android Module in Android Studio". Select "Open in New Window"
  • In the new window, expand "Gradle Scripts"
  • Locate "build.gradle" for all modules
  • In each of the gradle scripts, modify the compileSdkVersion from 27->28.
  • Search for <uses-sdk> tag in AndroidManifest files and remove.

Save the changes and build the signed apk (release version).