Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AAPT: error: resource android:attr/fontVariationSettings not found after Flutter Upgrade #27226

Closed
zanecidan opened this issue Jan 29, 2019 · 25 comments · May be fixed by jpush/janalytics-flutter-plugin#6
Labels
waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds

Comments

@zanecidan
Copy link

My flutter application used to work perfectly until recently I decided to upgrade to Flutter version 1.0.0. After upgrade I'm getting the below errors during compilation in one of my project:

AAPT: error: resource android:attr/fontVariationSettings not found.
AAPT: error: resource android:attr/ttcIndex not found.

FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDevelopmentDebugResources'.
> Failed to process resources, see aapt output above for details.

I've tried many things I can find in Google but none of them works. Appreciates for any help here.

@zoechi
Copy link
Contributor

zoechi commented Jan 29, 2019

Looks similar to #27106

@zoechi zoechi added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Jan 29, 2019
@zoechi
Copy link
Contributor

zoechi commented Jan 29, 2019

Please add the output of flutter doctor -v.

To investigate we would need a minimal runnable reproduction
as a single file so that we can just copy your code into lib/main.dart of a new project and run to reproduce.

@zanecidan
Copy link
Author

flutter doctor -v

[√] Flutter (Channel stable, v1.0.0, on Microsoft Windows [Version 10.0.17134.523], locale en-US)
    • Flutter version 1.0.0 at C:\src\flutter\flutter_windows_v0.5.1-beta\flutter
    • Framework revision 5391447fae (9 weeks ago), 2018-11-29 19:41:26 -0800
    • Engine revision 7375a0f414
    • Dart version 2.1.0 (build 2.1.0-dev.9.4 f9ebf21297)

[!] Android toolchain - develop for Android devices (Android SDK 28.0.3)
    • Android SDK at C:\Users\Chin Ying Jie\AppData\Local\Android\sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.3
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b02)
    ! Some Android licenses not accepted.  To resolve this, run: flutter doctor --android-licenses

[√] Android Studio (version 3.1)
    • Android Studio at C:\Program Files\Android\Android Studio
    X Flutter plugin not installed; this adds Flutter specific functionality.
    X Dart plugin not installed; this adds Dart specific functionality.
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b02)

[√] VS Code, 64-bit edition (version 1.25.1)
    • VS Code at C:\Program Files\Microsoft VS Code
    • Flutter extension version 2.21.1

[!] Connected device
    ! No devices available

! Doctor found issues in 2 categories.

#27106 is about moving to AndroidX, but I'm not planning to move as of now. Still using version 27.1.1.

Strangely my 2 other applications work fine.

@no-response no-response bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Jan 29, 2019
@zoechi
Copy link
Contributor

zoechi commented Jan 29, 2019

#27106 (comment)

If you don't want to migrate your app off of the deprecated support libraries, then for now you can avoid this by staying pinned to the last major version and avoiding this change.

@zoechi zoechi added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Jan 29, 2019
@zanecidan
Copy link
Author

#27106 (comment)

If you don't want to migrate your app off of the deprecated support libraries, then for now you can avoid this by staying pinned to the last major version and avoiding this change.

I did the migration and I can compile now. Thanks @zoechi .

@no-response no-response bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Jan 29, 2019
@MarcinusX
Copy link
Contributor

Setting compileSdkVersion 28 in app/build.gradle fixed the issue for me.

@zoechi
Copy link
Contributor

zoechi commented Jan 29, 2019

@zanecidan does this fix it for you as well?

@zoechi zoechi added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Jan 29, 2019
@mklim
Copy link
Contributor

mklim commented Jan 29, 2019

It looks like this was fixed for @zanecidan a few posts above.

From here:

For anyone else seeing this issue, the root cause of this error message is because we introduced a breaking change to the plugins that migrated them from the deprecated Android support libraries to AndroidX (#23995). Unfortunately this update also requires a manual migration in apps using the plugins in cases where the apps are also relying on the original support libraries and/or aren't compiling to SDK 28 already (the case with the flutter (stable) create template).

If you want to keep using the latest major versions of the plugins, the official Android migration guide for AndroidX is here. Android Studio provides an automated migration tool for apps that will probably make migrating easiest (also described on that page). You can import a flutter app into AS by hitting "Open an existing android studio project" on the IDE's opening splash screen and then opening <my_app_root>/android/build.gradle.

If you don't want to migrate your app off of the deprecated support libraries, then for now you can avoid this by staying pinned to the last major version and avoiding this change.

@mklim mklim closed this as completed Jan 29, 2019
chunhunghan added a commit to chunhunghan/flutter-zxing that referenced this issue Jun 26, 2019
resource android:attr/fontVariationSettings not found
resource android:attr/ttcIndex not found
flutter/flutter#27226 (comment)
trevorwang pushed a commit to trevorwang/flutter-zxing that referenced this issue Jun 26, 2019
* change compileSdkVersion from 27 to 28

resource android:attr/fontVariationSettings not found
resource android:attr/ttcIndex not found
flutter/flutter#27226 (comment)

* Upgrade to AndroidX

add parameter for AndroidX
@nkmswot
Copy link

nkmswot commented Dec 7, 2019

My Compiledsdkversioin is 28 only. But still facing the same issue.

* What went wrong:

Execution failed for task ':url_launcher:verifyReleaseResources'.

> java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed

  D:\flutter-projects\project1\build\url_launcher\intermediates\res\merged\release\values\values.xml:236: error: resource android:attr/fontVariationSettings not found.

  D:\flutter-projects\project1\build\url_launcher\intermediates\res\merged\release\values\values.xml:237: error: resource android:attr/ttcIndex not found.

  error: failed linking references.

@alexda12
Copy link

I upgraded yesterday to 1.12.13. I now have exactly this issue. More info here #46881

@divyanshub024
Copy link

I'm also facing the same issue when I run flutter build apk

FAILURE: Build failed with an exception.                                                                           
                                                                                                                   
* What went wrong:                                                                                                 
Execution failed for task ':thumbnails:verifyReleaseResources'.                                                    
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade                  
   > Android resource linking failed                                                                               
     /Users/divyanshub024/.gradle/caches/transforms-2/files-2.1/8ef0dd1b827b6b28c1e9211227fa2d4c/core-1.0.0/res/values/values.xml:57:5-88:25: AAPT: error: resource android:attr/fontVariationSettings not found.
                                                                                                                   
     /Users/divyanshub024/.gradle/caches/transforms-2/files-2.1/8ef0dd1b827b6b28c1e9211227fa2d4c/core-1.0.0/res/values/values.xml:57:5-88: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 2m 56s  

@sarinupreti
Copy link

I upgraded yesterday to 1.12.13. I have the same issue as well

@ChiHwe
Copy link

ChiHwe commented Dec 16, 2019

guys, i facing this issue too, can i know how you guys fix it?

@miguelcmedeiros
Copy link

I had this issue with a couple of plugins that my project uses:

  • devicelocale
  • vibrate

The issue was gone once these plugins were updated to use compiledsdkversioin set to 28.

paulosousadias added a commit to paulosousadias/multicast_lock that referenced this issue Dec 16, 2019
@adrianvintu
Copy link

@ayham95
Copy link

ayham95 commented Dec 18, 2019

If anyone has this issue with some package

  • In your project folder go to External libraries
  • Locate the library that raised the issue
  • Open it's build.gradle(app)
  • update the compileSdkVersion to 28

@bobanminic96
Copy link

bobanminic96 commented Dec 20, 2019

If anyone has this issue with some package

  • In your project folder go to External libraries
  • Locate the library that raised the issue
  • Open it's build.gradle(app)
  • update the compileSdkVersion to 28

Didnt work for me. Didnt find solution already. Any suggestions ?
My build.gradle was set to compileSdkVersion to 28 .

Plus, android studio throws exception 'Cannot resolve symbol GradleException' at line 11 , but i ignore that one.

Neither this: #46881 alexda12 reply did not work.

@AleksMx
Copy link

AleksMx commented Dec 27, 2019

I fixed this error by changing compileSdkVersion from 27 to 28 in one of the dependencies. So check build.gradle file in the repo of every dependency that you use.

@gopalsgs
Copy link

gopalsgs commented Jan 7, 2020

If anyone has this issue with some package

  • In your project folder go to External libraries
  • Locate the library that raised the issue
  • Open it's build.gradle(app)
  • update the compileSdkVersion to 28

Thank you. It solved the issue

@shadyshrif
Copy link

shadyshrif commented Jan 22, 2020

If anyone has this issue with some package

  • In your project folder go to External libraries
  • Locate the library that raised the issue
  • Open it's build.gradle(app)
  • update the compileSdkVersion to 28

Thanks this worked for me I had this issue in sharedpreferences package! I didn't know why!

Can we open an issue for that?

@shadyshrif
Copy link

shadyshrif commented Jan 22, 2020

For those who still couldn't solve the issue, first of all find this line in your error log

com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed
[your project path]\build\ [the package that has the problem] \intermediates\res\merged\release\values\values.xml

To solve the issue

1- open android studio
2- open the android project of your app. (take care not NOT the app itself)
3- on the left make sure that you view in "project" or "android" view
4- You will find all your packages listed, open expand [the package that has the problem]\android
5- open [the package that has the problem] build.gradle
6- make sure that compileSdkVersion 28 not 27

wasabia added a commit to wasabia/janalytics-flutter-plugin that referenced this issue Feb 7, 2020
figengungor added a commit to figengungor/page_view_indicators that referenced this issue Feb 15, 2020
@dsmailpuneet
Copy link

I'm also facing the same issue when I run flutter build apk

FAILURE: Build failed with an exception.                                                                           
                                                                                                                   
* What went wrong:                                                                                                 
Execution failed for task ':thumbnails:verifyReleaseResources'.                                                    
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade                  
   > Android resource linking failed                                                                               
     /Users/divyanshub024/.gradle/caches/transforms-2/files-2.1/8ef0dd1b827b6b28c1e9211227fa2d4c/core-1.0.0/res/values/values.xml:57:5-88:25: AAPT: error: resource android:attr/fontVariationSettings not found.
                                                                                                                   
     /Users/divyanshub024/.gradle/caches/transforms-2/files-2.1/8ef0dd1b827b6b28c1e9211227fa2d4c/core-1.0.0/res/values/values.xml:57:5-88: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 2m 56s  

Do you get solution?

@gmlewis
Copy link

gmlewis commented Mar 19, 2020

@hatted
Copy link

hatted commented Mar 21, 2020

I remove all unused plugins from External Libraries folder and pub.yaml to solve the problem.

@lock
Copy link

lock bot commented Apr 4, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@lock lock bot locked and limited conversation to collaborators Apr 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds
Projects
None yet
Development

Successfully merging a pull request may close this issue.