Java Android-Firebase手机身份验证不兼容ClassChangeError
我正在尝试集成firebase电话身份验证,但下面附加了Java Android-Firebase手机身份验证不兼容ClassChangeError,java,android,firebase,google-api,firebase-authentication,Java,Android,Firebase,Google Api,Firebase Authentication,我正在尝试集成firebase电话身份验证,但下面附加了不兼容ClassChangeError堆栈跟踪。我还附加了根/应用级别的Gradle文件 我用过 来自谷歌的代码片段库 我已按照文档中所述正确执行了每个步骤 我添加了sha1和SH256指纹 我还试图纠正Gradle版本和firebase依赖,但没有成功 错误日志: 我的应用程序级别渐变 plugins { id 'com.android.application' id 'com.google.gms.google-services'
不兼容ClassChangeError
堆栈跟踪。我还附加了根/应用级别的Gradle文件
我用过
来自谷歌的代码片段库
我已按照文档中所述正确执行了每个步骤
plugins {
id 'com.android.application'
id 'com.google.gms.google-services'
}
android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
defaultConfig {
applicationId "com.aihighway.aihscreening"
minSdkVersion 21
targetSdkVersion 30
versionCode 1
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.3.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'com.airbnb.android:lottie:3.7.0'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.3.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.gordonwong:material-sheet-fab:1.2.1'
implementation 'com.github.AnyChart:AnyChart-Android:1.1.2'
implementation("com.squareup.okhttp3:okhttp:4.9.0")
implementation 'com.google.code.gson:gson:2.8.6'
implementation 'com.github.MackHartley:RoundedProgressBar:2.1.0'
implementation 'org.apache.commons:commons-math3:3.6.1'
implementation 'com.google.firebase:firebase-auth:21.0.0'
implementation 'com.google.firebase:firebase-auth-ktx:21.0.0'
implementation 'com.google.firebase:firebase-core:19.0.0'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
}
我的根级别build.gradle
buildscript {
repositories {
google()
mavenCentral()
maven { url 'https://plugins.gradle.org/m2/' }
}
dependencies {
classpath 'com.android.tools.build:gradle:4.2.0'
classpath 'com.google.gms:google-services:4.2.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
mavenCentral()
maven { url 'https://plugins.gradle.org/m2/' }
maven { url "https://jitpack.io" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
我设法找到了一个解决办法,我将firebase版本降级到了20.0.0,它对我很有效