title: Flutter, background fetch package not working, androidx incompatibility
body: <p>I wanted to make some operations while the app was not running, so I decided to use the background fetch package.I followed the android setup step by step
  This is part of my pubspec.yaml</p>
  <pre><code>version: 1.0.0+1
  
  environment:
    sdk: &quot;&gt;=2.1.0 &lt;3.0.0&quot;
  
  dependencies:
    flutter:
      sdk: flutter
  
  
    google_maps_flutter: ^0.5.16
    geolocator: ^5.1.1
    flutter_local_notifications: ^0.7.1+1
    shared_preferences: '0.5.6+3'
    background_fetch: '^0.5.1'
  </code></pre>
  <p>This is part of my AndroidManifest.xml</p>
  <pre><code>&lt;manifest xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
      xmlns:tools=&quot;http://schemas.android.com/tools&quot;
      package=&quot;firenzepuliziastrade.firenze_pulizia_strade&quot;&gt;
      &lt;!-- io.flutter.app.FlutterApplication is an android.app.Application that
           calls FlutterMain.startInitialization(this); in its onCreate method.
           In most cases you can leave this as-is, but you if you want to provide
           additional functionality it is fine to subclass or reimplement
           FlutterApplication and put your custom class here. --&gt;
      &lt;uses-permission android:name=&quot;android.permission.ACCESS_COARSE_LOCATION&quot; /&gt;
      &lt;uses-permission android:name=&quot;android.permission.INTERNET&quot;/&gt;
      &lt;uses-permission android:name=&quot;android.permission.RECEIVE_BOOT_COMPLETED&quot;/&gt;
      &lt;uses-permission android:name=&quot;android.permission.VIBRATE&quot; /&gt;
      &lt;uses-permission android:name=&quot;android.permission.WAKE_LOCK&quot; /&gt;
      &lt;application
          tools:replace=&quot;android:label&quot;
          android:name=&quot;io.flutter.app.FlutterApplication&quot;
          android:label=&quot;Firenze Pulizia Strade&quot;
          android:icon=&quot;@mipmap/ic_launcher&quot;&gt;
  </code></pre>
  <p>This is part of my app/build.gradle</p>
  <pre><code>android {
      compileSdkVersion rootProject.ext.compileSdkVersion
  
  
      defaultConfig {
          // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
          applicationId &quot;firenzepuliziastrade.firenze_pulizia_strade&quot;
          minSdkVersion 16
          targetSdkVersion rootProject.ext.targetSdkVersion
          versionCode flutterVersionCode.toInteger()
          versionName flutterVersionName
          testInstrumentationRunner &quot;androidx.test.runner.AndroidJUnitRunner&quot;
      }
  
  }
  
  
  dependencies {
      implementation &quot;org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version&quot;
      testImplementation 'junit:junit:4.12'
      androidTestImplementation 'androidx.test:runner:1.1.1'
      androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
  }
  </code></pre>
  <p>This is part of my android/build.gradle</p>
  <pre><code>buildscript {
      ext.kotlin_version = '1.3.50'
      ext {
          compileSdkVersion   = 28                // or higher
          targetSdkVersion    = 28                // or higher
          appCompatVersion    = &quot;1.1.0&quot;           // or higher
      }
  
      repositories {
          google()
          jcenter()
      }
  
      dependencies {
          classpath 'com.android.tools.build:gradle:3.5.0'
          classpath &quot;org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version&quot;
      }
  }
  
  allprojects {
      repositories {
          google()
          jcenter()
          maven {
              // [required] background_fetch
              url &quot;${project(':background_fetch').projectDir}/libs&quot;
          }
      }
  }
  </code></pre>
  <p>This is my gradle.properties</p>
  <pre><code>org.gradle.jvmargs=-Xmx1536M
  android.enableR8=true
  android.useAndroidX=true
  android.enableJetifier=true
  </code></pre>
  <p>I tried even the additional step to enable the Headless mechanism even though I thought that it was not necessary since my flutter version is Flutter 1.12.13 and I created this project recently.
  But all that said I could not make the app do some work while not running, it just worked while being in the background. So I thought that the reason was that I was launching the app in debug mode and I tried to launch it in release mode, but I got the following error:</p>
  <pre><code>Launching lib/main.dart on POT LX1 in release mode...
  Running Gradle task 'assembleRelease'...
  
  FAILURE: Build failed with an exception.
  
  * What went wrong:
  Execution failed for task ':path_provider:verifyReleaseResources'.
  &gt; A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
     &gt; Android resource linking failed
       /home/nik/.gradle/caches/transforms-2/files-2.1/0a271e99b6771ad4a84318244d532fb7/core-1.0.0/res/values/values.xml:57:5-88:25: AAPT: error: resource android:attr/fontVariationSettings not found.
  
       /home/nik/.gradle/caches/transforms-2/files-2.1/0a271e99b6771ad4a84318244d532fb7/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 7s
  The built failed likely due to AndroidX incompatibilities in a plugin. The tool is about to try using Jetfier to solve the incompatibility.
  Building plugin background_fetch...
  Running Gradle task 'assembleAarRelease'...
  Finished with error: ProcessException: Permission denied
    Command: /home/nik/Desktop/Pulizia_Strade/flutter/.pub-cache/hosted/pub.dartlang.org/background_fetch-0.5.6/android/gradlew -I=/home/nik/Desktop/Pulizia_Strade/flutter/packages/flutter_tools/gradle/aar_init_script.gradle -Pflutter-root=/home/nik/Desktop/Pulizia_Strade/flutter -Poutput-dir=/home/nik/Desktop/Pulizia_Strade/firenze_pulizia_strade/build/app -Pis-plugin=true -Ptarget-platform=android-arm,android-arm64,android-x64 assembleAarRelease
  </code></pre>
  <p>I tried to create a new flutter project, specifying androidx, but it did notwork, I got the same error. Can someone help me, I really do not know what to do at this point...</p>