问题描述
我正在使用Firebase将Facebook SDK添加到我的Unity Android项目中. PlayServicesResolver中存在一些文件冲突,因此我强制解决它.但是当我按下Facebook登录按钮时.错误出来了.
I am adding Facebook SDK into my Unity Android project with Firebase. There are some files conflict in PlayServicesResolver so I force resolve it. But when I press the Facebook Login button. Error comes out.
实际上,我通常会多次遇到类似的问题,尤其是有时使用不同版本的PlayServiceResolver的SDK.我尝试重新导入所有资产并强行解决.但是这些方法无济于事.还是我专注于错误的文件夹?我看过Android插件文件夹,但还是不知道.有人可以帮忙吗?
Actually I usually face the similar problems many times, especially sometimes those sdk using different versions of PlayServiceResolver. I have tried reimport all the asset and force resolve. But these methods do not help. Or do I focus on the wrong folder? I have taken a look in the Android plugin folder but still get no idea. Anyone may help?
我的Firebase在5.3.1中(以前是5.4.1,但升级后与其他SDK冲突).我的Unity在2018.2.14f1.
My Firebase is in 5.3.1 (it was 5.4.1 but it conflicts with other sdk after upgrading). My Unity is in 2018.2.14f1.
推荐答案
包含在您的应用程序级别Gradle中
include in your App level Gradle
implementation 'com.google.firebase:firebase-auth:16.0.5'
implementation project(path: ':loginwithgoogle_facebook_from_firebase')
在LoginActivity中调用以下代码
call below code in your 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文件.
Make sure you have google-services.json file download from Firebase console.
您可以查看我的GitHub存储库以获取完整的示例
You can check my GitHub repository for a complete example
https://github.com/HemantSharmaDevloper/Login_with_Facebook_google_firebase
这篇关于找不到FirebaseAuthWebException.请验证AAR的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!