【问题标题】:Facebook Authentication Not Working with Firebase UI in AndroidFacebook 身份验证不适用于 Android 中的 Firebase UI
【发布时间】:2018-01-26 04:43:50
【问题描述】:

我之前在几个项目中使用过 Firebase UI 来实现身份验证,但是,由于某种原因,我无法让 Facebook 身份验证在当前项目中工作。每次单击“使用 Facebook 登录”按钮时,它都会启动看似身份验证流程,然后返回身份验证 UI 屏幕而不执行任何操作。

没有在 Firebase 控制台中创建帐户,也没有在 Facebook 上记录任何内容。以下是我已采取并仔细检查的步骤。

  1. 将 Firebase UI 最新库添加到项目 - 2.2.0
  2. 添加 Facebook Android SDK
  3. 将其他 Firebase 库更新到 11.4.0
  4. 确保 Google Play 服务为 3.0.0
  5. 确保在 Firebase 控制台中启用 Facebook 身份验证
  6. 确保将 Facebook 应用 ID 和应用机密添加到 Firebase 控制台
  7. 确保将 Firebase oAuth 重定向添加到 Facebook
  8. 确保应用已正确添加到 Facebook 并启用
  9. 确保将 Facebook 应用 ID 添加到 res/string 资源文件中
  10. 使用了与我不同的 Facebook 帐户 开发者帐号
  11. 在两种不同的物理设备上试用过

没有错误消息,没有日志猫,我还能缺少什么?任何帮助将不胜感激这是我的 AuthUiActivity

https://gist.github.com/valokafor/d4d5663bcdcf999be1cd41f331a3b883

这是我的 Gradle 依赖项

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')

    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })

    androidTestCompile('com.android.support.test.espresso:espresso-contrib:2.2') {
        // Necessary to avoid version conflicts
        exclude group: 'com.android.support', module: 'appcompat'
        exclude group: 'com.android.support', module: 'support-v4'
        exclude group: 'com.android.support', module: 'support-annotations'
        exclude module: 'recyclerview-v7'
    }


    compile('org.mnode.ical4j:ical4j:1.0.6') {
        exclude group: 'commons.io'
    }


    compile "com.android.support:appcompat-v7:$rootProject.supportLibraryVersion"
    compile "com.android.support:design:$rootProject.supportLibraryVersion"
    compile "com.android.support:cardview-v7:$rootProject.supportLibraryVersion"
    compile "com.android.support:support-vector-drawable:$rootProject.supportLibraryVersion"
    compile "com.android.support:recyclerview-v7:$rootProject.supportLibraryVersion"
    compile "com.android.support:support-v4:$rootProject.supportLibraryVersion"

    compile('com.mikepenz:materialdrawer:5.9.1@aar') {
        transitive = true
    }


    compile 'com.android.support:multidex:1.0.1'
    compile 'com.afollestad.material-dialogs:core:0.9.4.5'
    compile 'com.google.android.gms:play-services-auth:11.0.4'
    compile 'com.google.firebase:firebase-crash:11.0.4'
    compile 'com.google.firebase:firebase-core:11.0.4'
    compile 'com.google.firebase:firebase-ads:11.0.4'
    compile 'com.google.firebase:firebase-messaging:11.0.4'
    compile 'com.google.firebase:firebase-auth:11.0.4'
    compile 'com.firebaseui:firebase-ui:2.2.0'
    compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha9'
    compile 'org.greenrobot:eventbus:3.0.0'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
    compile 'com.github.bumptech.glide:glide:3.7.0'
    compile 'be.billington.calendar.recurrencepicker:library:1.1.1'
    compile 'org.ocpsoft.prettytime:prettytime:3.2.7.Final'
    compile 'com.jakewharton:butterknife:8.5.1'
    compile 'de.hdodenhof:circleimageview:2.1.0'
    compile 'commons-io:commons-io:2.5'
    compile 'org.apache.commons:commons-collections4:4.1'
    compile 'com.afollestad:material-camera:0.4.4'
    compile 'com.google.android:flexbox:0.2.5'
    compile 'com.github.fiskurgit:ChipCloud:3.0.3'
    compile 'com.github.adroitandroid:ChipCloud:2.2.1'
    compile 'com.facebook.android:facebook-android-sdk:4.22.1'
    compile 'com.google.code.gson:gson:2.8.1'
    testCompile 'junit:junit:4.12'
    testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.1'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1'
    debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5.1'
    releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.1'
}

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

Firebase 身份验证控制台

【问题讨论】:

    标签: android facebook firebase firebase-authentication firebaseui


    【解决方案1】:

    事实证明,这是一件非常简单的事情。

    Facebook id 应该像这样添加到字符串中:

    <string name="facebook_application_id" translatable="false">98765xxxxxxx</string>
    

    而不是像这样出现在 Firebase UI 文档中的方式

      <string name="facebook_app_id" translatable="false">987565xxxxxx</string>
    

    一旦我进行了更新,感谢FirebaseUI Authentication with Facebook not logging in这个问题,问题得到了解决

    【讨论】:

      猜你喜欢
      • 2019-04-07
      • 1970-01-01
      • 2017-11-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-11-21
      • 2020-04-30
      相关资源
      最近更新 更多