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平台选项

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

相关推荐
丁小未6 小时前
基于MVVM框架的XUUI 扩展的UI管理系统教程
unity·mvvm·ui框架·xuui·ui管理器
丁小未1 天前
基于MVVM框架的XUUI HelloWorld 新手教程
unity·性能优化·c#·游戏引擎
丁小未1 天前
基于MVVM框架的XUUI MoreComplex案例
unity·c#
EQ-雪梨蛋花汤1 天前
【Unity笔记】VR 一体机画面锯齿、模型边缘闪烁、接缝抖动排查:MSAA、Mipmap、Render Scale、Z-Fighting 全流程记录
笔记·unity·vr
松树戈1 天前
【Godot4精进之路】03~Godot编辑器常用界面介绍
编辑器·游戏引擎·godot
YigAin1 天前
Unity Spine 资源出现白边的解决办法
unity·游戏引擎·spine
郝学胜-神的一滴2 天前
中级OpenGL教程 013:渲染器类架构设计与逐帧渲染流程详解
开发语言·c++·unity·游戏引擎·图形渲染·opengl·unreal
_helen_5202 天前
unreal engine 虚拟现实 + airsim
游戏引擎·vr·虚幻
真鬼1234 天前
【Unity WebGL】内嵌网页与双向通信
unity·游戏引擎·webgl
zyh______4 天前
C#语法糖(按照实用性排序)
unity·c#