Android Firebase UI无法访问AAD

Mack程序很多

当我去运行我的应用程序时遇到以下错误:无法访问com.google.android.gms.internal.aad的aad类文件

我想这将是一个build.gradle问题。但是,我的构建文件中似乎找不到任何内容。

这是顶层build.gradle

buildscript {
repositories {
    jcenter()
}
dependencies {
    classpath 'com.android.tools.build:gradle:2.3.3'
    classpath 'com.google.gms:google-services:3.1.0'
}
}

allprojects {
repositories {
    jcenter()
    maven {
        url "https://maven.google.com"
    }
}
}

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

这是应用程序级别的build.grade:

apply plugin: 'com.android.application'

android {
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
    applicationId "com.somesite.foo"
    minSdkVersion 16
    targetSdkVersion 26
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    resConfigs "auto"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
    exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:26.+'
testCompile 'junit:junit:4.12'
compile 'com.google.firebase:firebase-core:11.2.0'
compile 'com.firebaseui:firebase-ui-auth:2.3.0'
compile('com.facebook.android:facebook-android-sdk:4.22.1')
}

apply plugin: 'com.google.gms.google-services'

这是试图使一切开始的活动:

protected void onCreate(Bundle savedInstanceState) {
    setTheme(R.style.SplashTheme);
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_splash);
    FirebaseAuth auth = FirebaseAuth.getInstance();
    if (auth.getCurrentUser() != null)
    {
        // already signed in
        auth.signOut();
    }
    else
    {
        //AuthU
        // not signed in
        startActivityForResult(
                AuthUI.getInstance()
                        .createSignInIntentBuilder()
                        .setIsSmartLockEnabled(false)
                        .setAvailableProviders(
                                Arrays.asList(new AuthUI.IdpConfig.Builder(AuthUI.EMAIL_PROVIDER).build(),
                                        new AuthUI.IdpConfig.Builder(AuthUI.GOOGLE_PROVIDER).build(),
                                        new AuthUI.IdpConfig.Builder(AuthUI.FACEBOOK_PROVIDER).build()))
                        .build(),
                RC_SIGN_IN);
    }

}
鲍勃·斯奈德

该问题很可能是由于与firebase-ui-auth:2.3.0不兼容引起的firebase-core:11.2.0最简单的修复是将版本降级为11.0.4,该版本与firebase-ui-auth:2.3.0以下版本兼容

compile 'com.google.firebase:firebase-core:11.0.4' // CHANGED
compile 'com.firebaseui:firebase-ui-auth:2.3.0'
compile('com.facebook.android:facebook-android-sdk:4.22.1')

如果要坚持使用11.2.0,则可以通过以下更改将2.3.0升级为使用11.2.0版:

compile 'com.google.firebase:firebase-core:11.2.0'
compile 'com.google.firebase:firebase-auth:11.2.0' // ADDED
compile 'com.google.android.gms:play-services-auth:11.2.0' // ADDED
compile 'com.firebaseui:firebase-ui-auth:2.3.0'
compile('com.facebook.android:facebook-android-sdk:4.22.1')

有关库版本兼容性的说明,请参阅FirebaseUI文档

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章