我正在使用Firebase UI-Auth进行身份验证,但是在添加了分析依赖性之后,出现了此错误。空闲一段时间后,应用程序崩溃。有时它在重新启动几次后仍会在初次启动时崩溃。我还已经将所有库更新为最新版本,但这也无济于事。
致命异常:java.lang.NoSuchFieldError没有字段 类型的PREFER_HIGHEST_OR_REMOTE_VERSION_NO_FORCE_STAGING Lcom / google / android / gms / dynamite / DynamiteModule $ VersionPolicy;在 Lcom / google / android / gms / dynamite / DynamiteModule类;或其 超类(的声明 “ com.google.android.gms.dynamite.DynamiteModule”出现在base.apk中)
这是我的build.gradle
import com.google.gms.googleservices.GoogleServicesPlugin
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.26.1'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.hussain.podcastapp"
minSdkVersion 23
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
targetCompatibility 1.8
sourceCompatibility 1.8
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
implementation 'com.jakewharton:butterknife:9.0.0-SNAPSHOT'
implementation 'com.google.firebase:firebase-core:16.0.4'
implementation 'com.github.devlight.navigationtabstrip:navigationtabstrip:1.0.4'
implementation 'com.squareup.retrofit2:converter-simplexml:2.3.0'
implementation 'com.github.florent37:glidepalette:2.1.2'
implementation 'androidx.palette:palette:1.0.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'com.airbnb.android:lottie:2.6.1'
implementation "com.mikepenz:materialdrawer:6.0.9"
implementation 'com.google.android.exoplayer:exoplayer-core:2.8.1'
implementation 'com.google.android.exoplayer:exoplayer-dash:2.8.0'
implementation 'com.google.android.exoplayer:exoplayer-ui:2.8.1'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.github.bumptech.glide:glide:4.8.0'
implementation 'com.firebase:firebase-jobdispatcher:0.8.5'
implementation 'com.firebaseui:firebase-ui-auth:4.1.0'
implementation 'com.google.firebase:firebase-database:16.0.3'
implementation 'androidx.room:room-runtime:2.0.0'
annotationProcessor 'androidx.room:room-compiler:2.0.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.8.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0-SNAPSHOT'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.0-beta02'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-beta02'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'com.google.android.gms:play-services-ads:17.0.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.5'
implementation 'com.crashlytics.sdk.android:answers:1.4.3'
}
apply plugin: 'com.google.gms.google-services'
GoogleServicesPlugin.config.disableVersionCheck = true
这是我的项目级别build.gradle
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.google.gms:google-services:4.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}