Flutterfire: [firebase_auth] cannot build release apk on android

Created on 10 Feb 2020  Â·  12Comments  Â·  Source: FirebaseExtended/flutterfire

Describe the bug
When trying to build an Android project that has a dependency on firebase_auth, I'm getting an error on build.

To Reproduce
Run flutter build apk --release in root.

Expected behavior
```
FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':store_redirect:verifyReleaseResources'.

    A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
    Android resource linking failed
    /Users/mmalik/.gradle/caches/transforms-2/files-2.1/65d7c2e42d6689e2e5aad074b6fced15/core-1.0.0/res/values/values.xml:57:5-88:25: AAPT: error: resource android:attr/fontVariationSettings not found.

    /Users/mmalik/.gradle/caches/transforms-2/files-2.1/65d7c2e42d6689e2e5aad074b6fced15/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
Running Gradle task 'assembleRelease'...
Running Gradle task 'assembleRelease'... Done 9,0s
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 firebase_auth...
Running Gradle task 'assembleAarRelease'...
Running Gradle task 'assembleAarRelease'... Done 2,4s

FAILURE: Build failed with an exception.

  • What went wrong:
    A problem occurred configuring root project 'firebase_auth'.

    SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.

  • 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

bug

Most helpful comment

@Marek00Malik what version do you use? I use 0.16.0 version, but still got the error.

All 12 comments

my pubspec.yaml

environment:
  sdk: ">=2.7.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter
  flutter_localizations:
    sdk: flutter

  cupertino_icons: ^0.1.2
  google_sign_in: ^4.1.1
  firebase_auth: ^0.15.4
  google_maps_flutter: ^0.5.21+16
  provider: ^4.0.2

  package_info: ^0.4.0+13
  store_redirect: ^1.0.1
  share: ^0.6.3+5

  url_launcher: ^5.4.1
  flutter_widgets: ^0.1.9
  permission_handler: ^4.1.0

  logger: ^0.7.0+2

  font_awesome_flutter: ^8.5.0
  flutter_svg: ^0.14.4
  flutter_cupertino_localizations: ^1.0.1

dev_dependencies:
  flutter_test:
    sdk: flutter

Any help here ?

When running on the cicd it loggs this error

FAILURE: Build failed with an exception.

* Where:
Build file '/Users/runner/.pub-cache/hosted/pub.dartlang.org/firebase_auth_web-0.1.2/android/build.gradle' line: 22

* What went wrong:
A problem occurred evaluating root project 'firebaseauth_web'.
> Failed to apply plugin [id 'com.android.library']
   > Minimum supported Gradle version is 5.4.1. Current version is 4.10.2. If using the gradle wrapper, try editing the distributionUrl in /Users/runner/.pub-cache/hosted/pub.dartlang.org/firebase_auth_web-0.1.2/android/gradle/wrapper/gradle-wrapper.properties to gradle-5.4.1-all.zip

When running on the cicd it loggs this error

FAILURE: Build failed with an exception.

* Where:
Build file '/Users/runner/.pub-cache/hosted/pub.dartlang.org/firebase_auth_web-0.1.2/android/build.gradle' line: 22

* What went wrong:
A problem occurred evaluating root project 'firebaseauth_web'.
> Failed to apply plugin [id 'com.android.library']
   > Minimum supported Gradle version is 5.4.1. Current version is 4.10.2. If using the gradle wrapper, try editing the distributionUrl in /Users/runner/.pub-cache/hosted/pub.dartlang.org/firebase_auth_web-0.1.2/android/gradle/wrapper/gradle-wrapper.properties to gradle-5.4.1-all.zip

If you go to https://pub.dev/packages/firebase_auth_web you will find that firebase_auth_web will automatically be added to your dependencies with firebase_auth: ^0.15.2.

So for time being I tagged version to firebase_auth: 0.15.1+1 (without ^).

Or you can go to gradle wrapper properties file for plugin & change it to 5.4.1 from 4.10.2 but that will be a workaround so it's a no-no for me at least.

Flutter version 1.12.13+hotfix.8

Hi @Marek00Malik
can you please provide your flutter doctor -v ,
and your flutter build apk --verbose
Thank you

flutter doctor -v

Default java version set to 8.0.242-amzn
➜  makromapa_mobile git:(backend-integration) ✗ flutter doctor -v
[✓] Flutter (Channel stable, v1.12.13+hotfix.8, on Mac OS X 10.15.3 19D76, locale pl-PL)
    • Flutter version 1.12.13+hotfix.8 at /Users/mmalik/Desktop/DevTools/flutter
    • Framework revision 0b8abb4724 (5 weeks ago), 2020-02-11 11:44:36 -0800
    • Engine revision e1e6ced81d
    • Dart version 2.7.0


[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    • Android SDK at /Users/mmalik/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-29, build-tools 29.0.2
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.3.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.3.1, Build version 11C504
    • CocoaPods version 1.8.4

[✓] Android Studio (version 3.6)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 44.0.2
    • Dart plugin version 192.7761
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)

[!] IntelliJ IDEA Ultimate Edition (version 2019.3.3)
    • IntelliJ at /Applications/IntelliJ IDEA.app
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
    • For information about installing plugins, see
      https://flutter.dev/intellij-setup/#installing-the-plugins

[!] IntelliJ IDEA Community Edition (version 2019.3.3)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
    • For information about installing plugins, see
      https://flutter.dev/intellij-setup/#installing-the-plugins

[✓] Connected device (1 available)
    • iPhone 8 • 9DF0D6E4-3998-4078-AD9B-9842E5A1F84A • ios • com.apple.CoreSimulator.SimRuntime.iOS-13-3 (simulator)

! Doctor found issues in 2 categories.

flutter build apk --verbose
https://drive.google.com/open?id=1dIHvwOM88ARzsiZAtcGt-ImD67qR1Ckb
[ +1 ms] Note: /Users/mmalik/Desktop/DevTools/flutter/.pub-cache/hosted/pub.dartlang.org/google_maps_flutter-0.5.24+1/android/src/main/java/io/flutter/plugins/googlemaps/GoogleMapController.java uses unchecked or unsafe operations.
[ +1 ms] Note: Recompile with -Xlint:unchecked for details.

Any news ?

Closing, the latest version resolves the problem for android builds.

@Marek00Malik what version do you use? I use 0.16.0 version, but still got the error.

Closing, the latest version resolves the problem for android builds.

It is not resolved please check ..! Just mentioning resolved does't means it is resolved. It was working previously when i upgrade it gives me error same. Please fix this ASAP.

same here

FAILURE: Build failed with an exception.

  • Where:
    Build file '/Users/builder/programs/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth_web-0.1.3+1/android/build.gradle' line: 22

  • What went wrong:
    A problem occurred evaluating root project 'firebaseauth_web'.

    Failed to apply plugin [id 'com.android.library']
    Minimum supported Gradle version is 5.4.1. Current version is 4.10.2. If using the gradle wrapper, try editing the distributionUrl in /Users/builder/programs/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth_web-0.1.3+1/android/gradle/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 7s

The plugin firebase_auth_web could not be built due to the issue above.

Build failed :|
Failed to build for Android

Could everyone who still has this problem please file a new issue with the exact description of what happens, logs and the output of flutter doctor -v.
All system setups can be slightly different, so it's always better to open new issues and reference related issues.

Was this page helpful?
0 / 5 - 0 ratings