Flutter Android build fail after updating packages. AndroidX error

1,355

If you want to find out more about the AndroidX warning, the Flutter team has published a full article on AndroidX compatibility. You can follow it here.

The actual error message is the following:

error: resource android:attr/fontVariationSettings not found.

There are various resources outlining this problem. I suggest you to start here. However, it might be connected to AndroidX, so if you have not yet followed the guide on migrating, you might want to do that.

Share:
1,355
Remo Bajwa
Author by

Remo Bajwa

Updated on December 10, 2022

Comments

  • Remo Bajwa
    Remo Bajwa over 1 year

    I am trying to run flutter build apk but keep getting the following error. iOS is working perfectly. I am not sure what is going here. Any help would be greatly appreciated.

    Here is my pubspec.yaml

      intl: ^0.15.6
      cupertino_icons: ^0.1.2
      firebase_auth: 0.8.1+4
      google_sign_in:
      cloud_firestore: 0.9.0+1
      shared_preferences: ^0.4.3
      firebase_messaging: 3.0.1
      image_picker:
      firebase_storage: 
      cached_network_image:
      firebase_core:
      image:
      photo_view:
      flutter_auth_buttons:
      splashscreen:
      geolocator: 3.0.0
      color: any
      folding_cell: "^0.1.0"
      google_maps_flutter: 0.3.0
      stream_transform: ^0.0.14+1
      chewie:
      rxdart:
      flutter_sms:
      flutter_html: ^0.9.4
    

    This is some of the error in the terminal. There is a bit more, but I think this on is key.

    Initializing gradle...                                       3.1s
    Resolving dependencies...                                    6.8s
    Gradle task 'assembleRelease'...
    registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
    registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
    registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
    registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
    registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
             *********************************************************
    WARNING: This version of cloud_firestore will break your Android build if it or its dependencies aren't compatible with AndroidX.
             See "link" for more information on the problem and how to fix it.
             This warning prints for all Android build failures. The real root cause of the error may be unrelated.
             *********************************************************
    
    FAILURE: Build failed with an exception.
    
    * What went wrong:
    Execution failed for task ':google_api_availability:verifyReleaseResources'.
    > java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed
      Output:  /Users/remobajwa/Desktop/tu_chat/build/google_api_availability/intermediates/res/merged/release/values/values.xml:197: error: resource android:attr/fontVariationSettings not found.