我正在使用 Firebase 将 Facebook SDK 添加到我的 Unity Android 项目中。 PlayServicesResolver 中有一些文件冲突,所以我强制解决它。但是当我按下 Facebook 登录按钮时。出现错误。
Java class com/google/firebase/auth/FirebaseAuthWebException not found. Please verify the AAR which contains the com/google/firebase/auth/FirebaseAuthWebException class is included in your app.
其实我经常遇到类似的问题很多次,尤其是那些使用不同版本PlayServiceResolver的sdk。我试过重新导入所有 Assets 并强制解决。但这些方法都无济于事。还是我关注了错误的文件夹?我查看了 Android 插件文件夹,但仍然一无所知。有人可以帮忙吗?
我的 Firebase 是 5.3.1(它是 5.4.1,但升级后与其他 sdk 冲突)。我的Unity是2018.2.14f1。
最佳答案
包含在您的应用级 Gradle 中
implementation 'com.google.firebase:firebase-auth:16.0.5'
implementation project(path: ':loginwithgoogle_facebook_from_firebase')
在您的 LoginActivity 中调用以下代码
LoginButton loginButton = findViewById(R.id.fbLogin_Buttin_ID);
new FacebookFIrebaseLogin(mActivity, loginButton, new ResponceClass() {
@Override
public void updateUI(FirebaseUser user) {...}});
确保您已从 Firebase 控制台下载 google-services.json 文件。
您可以查看我的 GitHub 存储库以获取完整示例
https://github.com/HemantSharmaDevloper/Login_with_Facebook_google_firebase
关于android - 未找到 FirebaseAuthWebException。请验证 AAR,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53409085/