如果该版本的firebase_auth或其依赖项与AndroidX不兼容,则它将破坏您的Android构建

时间:2019-10-13 23:45:30

标签: android flutter firebase-authentication

我正在尝试构建apk以更新我在android应用商店中的应用。在这里值得注意的是,我使用的每个插件版本都与商店中已经存在的版本完全相同,因此以前已经构建了一个完全没有问题的apk。

[   +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

我已经阅读了很多有关此问题的文章,到目前为止,似乎没有任何方法可以解决此问题,但是其他帖子中似乎相关的信息是:

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

根级别build.gradle:

dependencies {
    classpath 'com.android.tools.build:gradle:3.5.1'
    classpath 'com.google.gms:google-services:4.3.2'
}

app文件夹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

无法弄清为什么会这样,并且错误消息中没有太多信息可以继续。有人遇到过这些androidx错误吗?

0 个答案:

没有答案