title: "flutter build apk" command fails after adding google_maps_flutter
body: <p>I'm new to flutter and android development. I have a problem when building apk file with <code>flutter build apk</code> command and it shows error like this</p>
  
  <pre><code>C:\src\flutter_projects\beresin&gt;flutter build apk
  You are building a fat APK that includes binaries for android-arm,
  android-arm64, android-x64.
  If you are deploying the app to the Play Store, it's recommended to use app
  bundles or split the APK to reduce the APK size.
      To generate an app bundle, run:
          flutter build appbundle --target-platform
          android-arm,android-arm64,android-x64
          Learn more on: https://developer.android.com/guide/app-bundle
      To split the APKs per ABI, run:
          flutter build apk --target-platform
          android-arm,android-arm64,android-x64 --split-per-abi
          Learn more on:
          https://developer.android.com/studio/build/configure-apk-splits#configu
  
          e-abi-split
  Running Gradle task 'assembleRelease'...
  
  
  FAILURE: Build failed with an exception.
  
  
  
  * What went wrong:
  
  Execution failed for task ':adhara_socket_io:verifyReleaseResources'.
  
  &gt; A failure occurred while executing com.android.build.gradle.internal.tasks.Wo
  kers$ActionFacade
  
     &gt; Android resource linking failed
  
       C:\Users\BERESIN\.gradle\caches\transforms-2\files-2.1\0a271e99b6771ad4a84
  18244d532fb7\core-1.0.0\res\values\values.xml:57:5-88:25: AAPT: error: resource
  android:attr/fontVariationSettings not found.
  
  
  
       C:\Users\BERESIN\.gradle\caches\transforms-2\files-2.1\0a271e99b6771ad4a84
  18244d532fb7\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 28s
  Running Gradle task 'assembleRelease'...                           29.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 adhara_socket_io...
  Running Gradle task 'assembleAarRelease'...                         1.8s
  √ Built build\app\outputs\repo.
  Building plugin flutter_plugin_android_lifecycle...
  Running Gradle task 'assembleAarRelease'...                         1.3s
  
  
  FAILURE: Build failed with an exception.
  
  * Where:
  Build file 'C:\src\flutters\.pub-cache\hosted\pub.dartlang.org\flutter_plugin_a
  droid_lifecycle-1.0.6\android\build.gradle' line: 22
  
  * What went wrong:
  A problem occurred evaluating root project 'flutter_plugin_android_lifecycle'.
  &gt; Failed to apply plugin [id 'com.android.library']
     &gt; Minimum supported Gradle version is 5.4.1. Current version is 4.10.2. If u
  ing the gradle wrapper, try editing the distributionUrl in C:\src\flutters\.pub
  cache\hosted\pub.dartlang.org\flutter_plugin_android_lifecycle-1.0.6\android\gr
  dle\wrapper\gradle-wrapper.properties to gradle-5.4.1-all.zip
  
  * 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 1s
  
  The plugin flutter_plugin_android_lifecycle could not be built due to the issue
  above.
  </code></pre>
  
  <p>after a long time searching for solution on google, I've found an answer to solve that. I changed the gradle's distributionUrl on flutter_plugin_android_lifecycle package in .pub-cache folder to 5.4.1 as suggested, but it leads to another error like this.</p>
  
  <pre><code>C:\src\flutter_projects\beresin&gt;flutter build apk
  You are building a fat APK that includes binaries for android-arm,
  android-arm64, android-x64.
  If you are deploying the app to the Play Store, it's recommended to use app
  bundles or split the APK to reduce the APK size.
      To generate an app bundle, run:
          flutter build appbundle --target-platform
          android-arm,android-arm64,android-x64
          Learn more on: https://developer.android.com/guide/app-bundle
      To split the APKs per ABI, run:
          flutter build apk --target-platform
          android-arm,android-arm64,android-x64 --split-per-abi
          Learn more on:
          https://developer.android.com/studio/build/configure-apk-splits#configur
  
          e-abi-split
  Running Gradle task 'assembleRelease'...
  
  
  FAILURE: Build failed with an exception.
  
  
  
  * What went wrong:
  
  Execution failed for task ':adhara_socket_io:verifyReleaseResources'.
  
  &gt; A failure occurred while executing com.android.build.gradle.internal.tasks.Wor
  kers$ActionFacade
  
     &gt; Android resource linking failed
  
       C:\Users\BERESIN\.gradle\caches\transforms-2\files-2.1\0a271e99b6771ad4a843
  18244d532fb7\core-1.0.0\res\values\values.xml:57:5-88:25: AAPT: error: resource
  android:attr/fontVariationSettings not found.
  
  
  
       C:\Users\BERESIN\.gradle\caches\transforms-2\files-2.1\0a271e99b6771ad4a843
  18244d532fb7\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 15s
  Running Gradle task 'assembleRelease'...                           16.3s
  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 adhara_socket_io...
  Running Gradle task 'assembleAarRelease'...                         1.6s
  √ Built build\app\outputs\repo.
  Building plugin flutter_plugin_android_lifecycle...
  Running Gradle task 'assembleAarRelease'...                        32.1s
  Starting a Gradle Daemon, 1 incompatible and 1 stopped Daemons could not be reus
  ed, use --status for details
  &gt; Task :assembleAarRelease UP-TO-DATE
  &gt; Task :preBuild UP-TO-DATE
  &gt; Task :preReleaseBuild UP-TO-DATE
  &gt; Task :compileReleaseAidl NO-SOURCE
  &gt; Task :compileReleaseRenderscript NO-SOURCE
  &gt; Task :checkReleaseManifest
  &gt; Task :generateReleaseBuildConfig
  &gt; Task :generateReleaseResValues
  &gt; Task :generateReleaseResources
  &gt; Task :packageReleaseResources
  &gt; Task :mergeReleaseShaders
  &gt; Task :compileReleaseShaders
  &gt; Task :generateReleaseAssets
  &gt; Task :packageReleaseAssets
  &gt; Task :packageReleaseRenderscript NO-SOURCE
  &gt; Task :parseReleaseLibraryResources
  &gt; Task :processReleaseJavaRes NO-SOURCE
  &gt; Task :mergeReleaseJniLibFolders
  &gt; Task :processReleaseManifest
  &gt; Task :prepareLintJarForPublish
  &gt; Task :javaPreCompileRelease
  &gt; Task :mergeReleaseNativeLibs
  &gt; Task :stripReleaseDebugSymbols
  &gt; Task :transformNativeLibsWithSyncJniLibsForRelease
  &gt; Task :generateReleaseRFile
  
  &gt; Task :compileReleaseJavaWithJavac FAILED
  17 actionable tasks: 17 executed
  
  C:\src\flutters\.pub-cache\hosted\pub.dartlang.org\flutter_plugin_android_lifecy
  cle-1.0.6\android\src\main\java\io\flutter\embedding\engine\plugins\lifecycle\Fl
  utterLifecycleAdapter.java:8: error: package androidx.lifecycle does not exist
  import androidx.lifecycle.Lifecycle;
                           ^
  C:\src\flutters\.pub-cache\hosted\pub.dartlang.org\flutter_plugin_android_lifecy
  cle-1.0.6\android\src\main\java\io\flutter\embedding\engine\plugins\lifecycle\Fl
  utterLifecycleAdapter.java:22: error: cannot find symbol
    public static Lifecycle getActivityLifecycle(
                  ^
    symbol:   class Lifecycle
    location: class FlutterLifecycleAdapter
  2 errors
  
  FAILURE: Build failed with an exception.
  
  * What went wrong:
  Execution failed for task ':compileReleaseJavaWithJavac'.
  &gt; Compilation failed; see the compiler error output for details.
  
  * 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 31s
  
  The plugin flutter_plugin_android_lifecycle could not be built due to the issue
  above.
  </code></pre>
  
  <p>in my pubspec.yaml file, I only installed 2 new packages in dependencies:</p>
  
  <pre><code>adhara_socket_io: ^0.4.1
  google_maps_flutter: ^0.5.25+3
  </code></pre>
  
  <p>and here's my flutter doctor output</p>
  
  <pre><code>C:\src\flutter_projects\beresin&gt;flutter doctor -v
  [√] Flutter (Channel stable, v1.12.13+hotfix.7, on Microsoft Windows [Version
      6.1.7601], locale en-US)
      • Flutter version 1.12.13+hotfix.7 at C:\src\flutters
      • Framework revision 9f5ff2306b (3 months ago), 2020-01-26 22:38:26 -0800
      • Engine revision a67792536c
      • Dart version 2.7.0
  
  [√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
  
      • Android SDK at C:\Users\BERESIN\AppData\Local\Android\Sdk
      • Android NDK location not configured (optional; useful for native profiling
  
        support)
      • Platform android-29, build-tools 28.0.3
      • ANDROID_HOME = C:\Users\BERESIN\AppData\Local\Android\Sdk
      • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
      • Java version OpenJDK Runtime Environment (build
        1.8.0_212-release-1586-b04)
      • All Android licenses accepted.
  
  [√] Android Studio (version 3.6)
      • Android Studio at C:\Program Files\Android\Android Studio
      • Flutter plugin version 45.1.1
      • Dart plugin version 192.7761
      • Java version OpenJDK Runtime Environment (build
        1.8.0_212-release-1586-b04)
  
  [√] VS Code (version 1.44.1)
      • VS Code at C:\Users\BERESIN\AppData\Local\Programs\Microsoft VS Code
      • Flutter extension version 3.9.1
  
  [√] Connected device (1 available)
      • Mi A2 Lite • 04ab7a9f0405 • android-arm64 • Android 9 (API 28)
  
  • No issues found!
  </code></pre>
  
  <p>any answer will be appreciated</p>