To my understanding, the dependency requested by firebase_auth (androidx.legacy:legacy-support-v4:26.0.0) doesn't exist; I can only find v1.0.0 on maven.
Edit: Also throws a similar error on flutter build apk --debug
firebase_auth in pubspec.yamlflutter build apk$ flutter build apk
Initializing gradle... 0.5s
Resolving dependencies... 13.6s
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 firebase_auth will break your Android build if it or its dependencies aren't compatible with AndroidX.
See https://goo.gl/CP92wY 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:
Could not determine the dependencies of task ':app:lintVitalRelease'.
> Could not resolve all task dependencies for configuration ':app:releaseRuntimeClasspath'.
> Could not find androidx.legacy:legacy-support-v4:26.0.0.
Required by:
project :app
> Could not find androidx.legacy:legacy-support-v4:26.0.0.
Required by:
project :app > project :firebase_auth > com.google.firebase:firebase-auth:16.0.5 > com.google.android.gms:play-services-basement:16.1.0
* 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 6s
Gradle task 'assembleRelease'... Done 6.9s
Gradle task assembleRelease failed with exit code 1
name: timeswap_core
description: A new Flutter project.
# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# Read more about versioning at semver.org.
#
# the number after '+' is the version code -- version name is before
version: 0.1.0+1
environment:
sdk: ">=2.0.0-dev.68.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
cloud_firestore:
firebase_auth:
google_sign_in:
dotenv:
colorize:
progress_hud:
square_in_app_payments:
uuid:
flutter_slidable:
flutter_sms:
dynamic_theme:
shared_preferences:
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.2
dev_dependencies:
flutter_test:
sdk: flutter
flutter_driver:
sdk: flutter
test: 1.5.1
flutter_launcher_icons:
flutter_icons:
android: true
ios: true
image_path: "assets/icon/icon.png"
# For information on the generic Dart part of this file, see the
# following page: https://www.dartlang.org/tools/pub/pubspec
# The following section is specific to Flutter.
flutter:
# The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in
# the material Icons class.
uses-material-design: true
# To add assets to your application, add an assets section, like this:
assets:
- cfg/env.json
- assets/
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.io/assets-and-images/#resolution-aware.
# For details regarding adding assets from package dependencies, see
# https://flutter.io/assets-and-images/#from-packages
# To add custom fonts to your application, add a fonts section here,
# in this "flutter" section. Each entry in this list should have a
# "family" key with the font family name, and a "fonts" key with a
# list giving the asset and other descriptors for the font. For
# example:
# fonts:
# - family: Schyler
# fonts:
# - asset: fonts/Schyler-Regular.ttf
# - asset: fonts/Schyler-Italic.ttf
# style: italic
# - family: Trajan Pro
# fonts:
# - asset: fonts/TrajanPro.ttf
# - asset: fonts/TrajanPro_Bold.ttf
# weight: 700
#
# For details regarding fonts from package dependencies,
# see https://flutter.io/custom-fonts/#from-packages
build.gradlebuildscript {
repositories {
google()
jcenter()
maven { url 'https://plugins.gradle.org/m2/' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.1'
classpath 'com.google.gms:google-services:4.2.0'
classpath 'com.google.firebase:firebase-auth:16.1.0'
classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:[0.10.2, 0.99.99]'
//classpath 'com.google.android.gms:play-services-basement:15.0.1'
}
subprojects {
project.configurations.all {
resolutionStrategy.eachDependency { details ->
if (details.requested.group == 'com.android.support'
&& !details.requested.name.contains('multidex')) {
details.useVersion "27.1.1"
}
// if (details.requested.group == 'androidx.legacy' && details.requested.name.contains('legacy-support-v4')) {
// details.useVersion "1.0.0"
// }
}
}
}
}
allprojects {
repositories {
google()
jcenter()
mavenCentral()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
task clean(type: Delete) {
delete rootProject.buildDir
}
build.gradledef localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdkVersion 28
lintOptions {
disable 'InvalidPackage'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.timeswap.timeswapcore"
minSdkVersion 21
targetSdkVersion 28
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
multiDexEnabled true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
}
}
}
flutter {
source '../..'
}
dependencies {
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.0-alpha4'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-alpha4'
// See https://stackoverflow.com/questions/50524672/build-fails-with-program-type-already-present-android-arch-core-util-function
implementation 'androidx.arch.core:core-runtime:2.0.0-beta01'
implementation 'androidx.arch.core:core-common:2.0.0-beta01'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
}
apply plugin: 'com.google.gms.google-services'
com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
$ flutter doctor -v
[√] Flutter (Channel beta, v1.1.8, on Microsoft Windows [Version 10.0.17134.556], locale en-US)
• Flutter version 1.1.8 at C:\flutter_windows_v0.11.11-beta\flutter
• Framework revision 985ccb6d14 (5 weeks ago), 2019-01-08 13:45:55 -0800
• Engine revision 7112b72cc2
• Dart version 2.1.1 (build 2.1.1-dev.0.1 ec86471ccc)
[√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK at C:\Users\Jackie\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-1248-b01)
• All Android licenses accepted.
[√] Android Studio (version 3.3)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin version 32.0.1
• Dart plugin version 182.5215
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
[!] IntelliJ IDEA Ultimate Edition (version 2018.2)
• IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA 2018.2.4
X Flutter plugin not installed; this adds Flutter specific functionality.
• Dart plugin version 182.5124
• For information about installing plugins, see
https://flutter.io/intellij-setup/#installing-the-plugins
[√] VS Code (version 1.31.1)
• VS Code at C:\Users\Jackie\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 2.22.3
[√] VS Code, 64-bit edition (version 1.26.1)
• VS Code at C:\Program Files\Microsoft VS Code
• Flutter extension version 2.22.3
[√] Connected device (1 available)
• SM N910T • c253d892 • android-arm • Android 6.0.1 (API 23)
@pujitm
The issue at https://github.com/flutter/flutter/issues/27982 has been closed and moved here. Future collaboration on this issue will be done here.
Hi, any updates? This just broke our builds! ;(
Hi @pujitm
I see there's an open issue addressing the case you described.
Please follow up on that issue,
I'm closing the current one as duplicate.
If you disagree please write in the comments
and I will reopen it.
Thank you
For me the issue with this error, and why it is so difficult to find a solution for it is that it is wrong. It took me weeks to resolve this issue because the error has absolutely 0 to do with firebase being incompatible with androidx and everything to do with my key file (your .jks file). For me, the file path was incorrect, and correcting this made everything work again like magic.
It is likely that if you are tearing your hair out over this issue, that this is not even an issue. Have a look at your key store file and make sure everything is correct with it. If the app runs perfectly fine, but will not build, there are only two files involved that are different. Your google-services.json and your keystore file.
Absolutely terrible error reporting.