在Flatter中使用firebase_auth的应用程序中添加图像选择器时,生成失败

在Flatter中使用firebase_auth的应用程序中添加图像选择器时,生成失败,firebase,flutter,dart,firebase-authentication,imagepicker,Firebase,Flutter,Dart,Firebase Authentication,Imagepicker,当我使用firebase_auth时,当我开始在Flatter中包含image_picker库时,构建成功并且运行良好,突然构建崩溃。以下是我尝试运行时遇到的错误: J:\flutter_projects\webdoc>flutter run --enable-software-rendering Using software rendering with device AOSP on IA Emulator. You may get better performance with ha

当我使用firebase_auth时,当我开始在Flatter中包含image_picker库时,构建成功并且运行良好,突然构建崩溃。以下是我尝试运行时遇到的错误:

 J:\flutter_projects\webdoc>flutter run --enable-software-rendering
Using software rendering with device AOSP on IA Emulator. You may get better performance with hardware mode by
configuring hardware rendering for your device.
Launching lib\main.dart on AOSP on IA Emulator in debug mode...
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:preDebugBuild'.
> Android dependency 'androidx.core:core' has different version for the compile (1.0.0) and runtime (1.0.2) classpath. You should manually set the same version via DependencyResolution

* 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 25s
Running Gradle task 'assembleDebug'...
Running Gradle task 'assembleDebug'... Done                        26.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.2s


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


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

项目的版本为

  cupertino_icons: ^0.1.2
  firebase_auth: ^0.15.3
  flushbar: ^1.9.1
  image_picker: ^0.6.2+3
  http: ^0.12.0+2
我甚至尝试使用图像选择器0.4.12+1,但也不起作用 我尝试设置jetifier=false,但这并不能解决问题

格雷德尔先生是

buildscript {
    repositories {
        google()
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.5.2'
        classpath 'com.google.gms:google-services:4.0.1'

    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

rootProject.buildDir = '../build'
subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
    project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

将android gradle更新为以下内容:

dependencies {
classpath 'com.android.tools.build:gradle:3.3.1'
}
并使用最新版本的
image\u picker
0.6.2+3

如果还出现以下错误:

未找到SDK位置。使用local.properties文件中的sdk.dir或ANDROID_HOME环境变量定义位置

然后,您需要在终端中执行以下操作:

export ANDROID_HOME="YOUR_SDK_PATH"

将build.gradle更新为3.3.1版,并使用firebase_auth和image_picker的最新版本,同时将分发url更改为

distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
库:

  firebase_auth: ^0.15.3
  image_picker: ^0.6.2+3