问题
I am trying to build an apk to update my app on the android app store. It is worth noting here that every plugin version that I use is absolutely identical to the version that is already on the store, and so has already previously built an apk with no issues at all.
[ +1 ms] *********************************************************
[ ] WARNING: This version of firebase_auth will break your Android build if it or its dependencies aren't compatible with AndroidX.
[ +1 ms] See https ://goo.gl /CP92wY for more information on the problem and how to fix it.
[ +1 ms] This warning prints for all Android build failures. The real root cause of the error may be unrelated.
[ ] *********************************************************
[ ] 355 actionable tasks: 16 executed, 339 up-to-date
[ +469 ms] Running Gradle task 'assembleRelease'... (completed in 65.3s)
[ +7 ms] "flutter apk" took 118,030ms.
Gradle task assembleRelease failed with exit code 1
I have done a lot of reading about this issue and so far nothing seems to work to resolve this, but the information that seems relevant from other posts is:
pubspec.yaml
dependencies:
flutter:
sdk: flutter
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: 0.1.2
firebase_admob: 0.5.5
screen: 0.0.5
image_picker: 0.6.1
firebase_auth: 0.11.1+7
shared_preferences: 0.4.3
rflutter_alert: 1.0.2
url_launcher: 5.0.3
in_app_purchase: 0.2.0
firebase_dynamic_links: 0.4.0+4
app_review: 1.0.0
auto_orientation: 1.0.4
vibration: 1.2.1
root level build.gradle:
dependencies {
classpath 'com.android.tools.build:gradle:3.5.1'
classpath 'com.google.gms:google-services:4.3.2'
}
app folder build.gradle:
android {
compileSdkVersion 29
lintOptions {
disable 'InvalidPackage'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "my.app"
minSdkVersion 19
targetSdkVersion 29
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile file(keystoreProperties['storeFile'])
storePassword keystoreProperties['storePassword']
}
}
buildTypes {
release {
signingConfig signingConfigs.release
}
}
}
flutter {
source '../..'
}
dependencies {
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'com.google.firebase:firebase-core:17.2.0'
}
apply plugin: 'com.google.gms.google-services'
gradle.properties:
android.enableJetifier=true
android.useAndroidX=true
org.gradle.jvmargs=-Xmx1536M
Can't work out why this is happening, and there is not much info in the error message to go on. Has anyone come across these androidx errors before?
来源:https://stackoverflow.com/questions/58368646/this-version-of-firebase-auth-will-break-your-android-build-if-it-or-its-depende