,这是我的模块应用程序。我认为firebaseUi依赖是导致错误的原因,但我不确定。谁来帮帮忙。
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'com.google.android.material:material:1.0.0'
implementation 'com.firebaseui:firebase-ui-database:6.0.2'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.google.firebase:firebase-auth:16.0.5'
implementation 'com.google.firebase:firebase-database:16.0.4'
implementation 'com.google.firebase:firebase-core:16.0.4'
implementation 'androidx.cardview:cardview:1.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
}应用程序崩溃,这是生成的堆栈跟踪的一部分
11-11 11:19:05.890 18032-18032/? E/Zygote: MountEmulatedStorage()
11-11 11:19:05.890 18032-18032/? E/Zygote: v2
11-11 11:19:05.900 18032-18032/? E/SELinux: [DEBUG] get_category: variable seinfo: default sensitivity: NULL, cateogry: NULL
11-11 11:19:06.320 18032-18032/com.example.mytasks E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.mytasks, PID: 18032
java.lang.NoClassDefFoundError: com.google.firebase.auth.internal.zzae
at com.google.firebase.auth.FirebaseAuth.zzcb(Unknown Source)
at com.google.firebase.auth.FirebaseAuth.zza(Unknown Source)
at com.google.firebase.auth.FirebaseAuth.<init>(Unknown Source)
at com.google.firebase.auth.FirebaseAuth.<init>(Unknown Source)
at com.google.firebase.auth.internal.zzj.<init>(Unknown Source)
at com.google.firebase.auth.zzp.create(Unknown Source)发布于 2019-11-15 04:17:28
我猜您错过了根级(项目级) Gradle文件中的一些依赖项。检查一下你是否有这些:
buildscript {
repositories {
// Check that you have the following line (if not, add it):
google() // Google's Maven repository
}
dependencies {
// ...
// Add the following line:
classpath 'com.google.gms:google-services:4.3.3' // Google Services plugin
}
}
allprojects {
// ...
repositories {
// Check that you have the following line (if not, add it):
google() // Google's Maven repository
// ...
}
}发布于 2019-11-15 04:44:03
显然,你似乎在使用不支持androidx的旧版本。
这里的解决方案是使用最新版本。
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'com.google.android.material:material:1.0.0'
implementation 'com.firebaseui:firebase-ui-database:6.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.google.firebase:firebase-auth:19.1.0'
implementation 'com.google.firebase:firebase-database:19.2.0'
// No longer required implementation 'com.google.firebase:firebase-core:17.2.1'
implementation 'com.google.firebase:firebase-analytics:17.2.1'
implementation 'androidx.cardview:cardview:1.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
}请参阅最新的版本,
https://stackoverflow.com/questions/58870224
复制相似问题