Unity + Firebase + GoogleSignIn 导入问题

我目前使用

Unity版本:2021.3.33f1

JDK版本为:1.8

Gradle 版本为:6.1.1

Firebase 版本: 9.6.0

Google Sign In 版本为: 1.0.1

问题1 :手机点击登录报错

apk转化成zip,解压,看到/lib/armeabi-v7a包含libnative-googlesignin.so,/lib/arm64-v8a中不存在libnative-googlesignin.so,这就导致手机点击登录报错,找不到native-googlesignin.so

查看GoogleSignIn/Editor/mm2repository/com/google/signin/google-signin-support/1.0.1/google-signin-support-1.0.1.aar文件,解压后发现arm64-v8a不存

所以需要重新构建 Package 在build.gradle中添加修改

问题2 : firebase关联 google登陆

Firebase 的Authentication选择登陆方法,添加gogole登陆

问题3 : Error SignInFragment Exception caught! Failed resolution of: Lcom/google/android/gms/common/api/Api$zzf;

修改.gradle文件(这里的问题主要是版本不正确)

版本如下:

复制代码
dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
// Android Resolver Dependencies Start
    implementation 'com.google.android.gms:play-services-auth:10+' // Assets/GoogleSignIn/Editor/GoogleSignInDependencies.xml:20
    implementation 'com.google.android.gms:play-services-base:18.1.0' // Assets/Firebase/Editor/AppDependencies.xml:17
    implementation 'com.google.firebase:firebase-analytics:21.1.1' // Assets/Firebase/Editor/FirestoreDependencies.xml:15
    implementation 'com.google.firebase:firebase-analytics-unity:9.6.0' // Assets/Firebase/Editor/AnalyticsDependencies.xml:18
    implementation 'com.google.firebase:firebase-app-unity:9.6.0' // Assets/Firebase/Editor/AppDependencies.xml:22
    implementation 'com.google.firebase:firebase-auth:21.0.8' // Assets/Firebase/Editor/AuthDependencies.xml:13
    implementation 'com.google.firebase:firebase-auth-unity:9.6.0' // Assets/Firebase/Editor/AuthDependencies.xml:20
    implementation 'com.google.firebase:firebase-common:20.1.2' // Assets/Firebase/Editor/AppDependencies.xml:13
    implementation 'com.google.firebase:firebase-crashlytics-ndk:18.2.13' // Assets/Firebase/Editor/CrashlyticsDependencies.xml:13
    implementation 'com.google.firebase:firebase-crashlytics-unity:9.6.0' // Assets/Firebase/Editor/CrashlyticsDependencies.xml:20
    implementation 'com.google.firebase:firebase-firestore:24.3.1' // Assets/Firebase/Editor/FirestoreDependencies.xml:13
    implementation 'com.google.firebase:firebase-firestore-unity:9.6.0' // Assets/Firebase/Editor/FirestoreDependencies.xml:20
    implementation 'com.google.signin:google-signin-support:1+' // Assets/GoogleSignIn/Editor/GoogleSignInDependencies.xml:11
// Android Resolver Dependencies End
**DEPS**}

问题4 : Attempt to load writable dex file: /data/user/0/com.dialog.soulmaster/cache/app_resources_lib.jar

确保firebase和Google的插件都勾选了Android平台选项

大家有问题的话可以留言,趁我刚搞完,还热乎

相关推荐
叶帆3 天前
【YFIOs】用C#开发硬件之设备上云
开发语言·unity·c#
久数君3 天前
AI三维建模工具“造形家”:地理场景三维化的高效解决方案
unity·glb·ai算法·ai三维建模工具·地图框选·造形家·城市建筑模型
会思考的猴子3 天前
Unity VFX 属性 Postion 和 TargetPostion
unity
hai3152475434 天前
九章编程法 · 猜数字游戏 (GW-BASIC 重构版) *
人工智能·microsoft·游戏引擎·游戏程序
心前阳光4 天前
Unity资源导入之自动化资源导入
unity·自动化·游戏引擎
心前阳光4 天前
Unity之2021.3.45f2c1发布安卓程序遇到的问题
android·unity·游戏引擎
纪纯4 天前
PicoVR Unity Integration SDK 3.4 常用交互API
unity·游戏引擎·vr·pico
龙智DevSecOps解决方案4 天前
3A 游戏优化技术栈:如何打通引擎级分析工具与 DevOps 持续集成管线?
unity·性能优化·游戏开发·技术美术·perforce·unrealengine
葛兰岱尔4 天前
从 SolidWorks 到 Three.js,从 Inventor 到 Unity——制造业CAD模型“几何-语义一体化“转换,不再是天方夜谭!
开发语言·javascript·unity
鼎艺创新科技4 天前
三维电子沙盘中OSGB倾斜摄影数据的加载与渲染
游戏引擎·cocos2d