【发布时间】:2020-05-22 05:55:52
【问题描述】:
我正在尝试让 Firebase Unity SDK 在 iOS 13 设备上运行。我能够构建项目,但问题是我无法注册或验证用户。
复制步骤:(我做了什么)
- 已下载 quickstart-unity/auth/testapp 项目
- 在 iOS 平台的 Unity 2019.2.20f1 中打开
- 将 Bundle ID 更改为我在 Firebase 控制台中注册的那个
- 将 GoogleService-Info.plist 放在 Assets/Firebase 文件夹下
- Set Resolver iOS 设置选项将 CocoaPods 添加到 Xcode 项目
- 将最新的 Firebase Auth 包 6.10.0 从 dotnet4 文件夹导入到项目中
- 已构建
我在 Xcode 项目中看到的:
- PodFile 内容如下所示:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
target 'Unity-iPhone' do
pod 'Firebase/Auth', '6.14.0'
pod 'Firebase/Core', '6.14.0'
end
- GoogleService-Info.plist 也在 Xcode 项目层次结构中
在装有 iOS 13 的 iPhone 8 上签名并构建。
结果:当我尝试填写字段电子邮件和密码并按下调用该方法的“创建用户”按钮时:
// Create a user with the email and password.
public Task CreateUserWithEmailAsync() {
DebugLog(String.Format("Attempting to create user {0}...", email));
DisableUI();
// This passes the current displayName through to HandleCreateUserAsync
// so that it can be passed to UpdateUserProfile(). displayName will be
// reset by AuthStateChanged() when the new user is created and signed in.
string newDisplayName = displayName;
return auth.CreateUserWithEmailAndPasswordAsync(email, password)
.ContinueWithOnMainThread((task) => {
EnableUI();
if (LogTaskCompletion(task, "User Creation")) {
var user = task.Result;
DisplayDetailedUserInfo(user, 1);
return UpdateUserProfileAsync(newDisplayName: newDisplayName);
}
return task;
}).Unwrap();
}
我在设备屏幕和 Xcode 日志中也看到了这个错误:
AuthError.Failure: Firebase.FirebaseException: An internal error has occurred, print and inspect the error details for more information.
这是来自 Xcode 的完整日志:
https://drive.google.com/file/d/1ZQzrA67NXqM-lwNsSqT8Dgam9XiSHD9y/view?usp=sharing
我也尝试过:
- 在 iOS 版本较低的设备上构建。
- 尝试使用 Unity 2019.1.11 和 2019.1.13 版本构建
- 尝试将 GoogleService-Info.plist 直接导入 Xcode 项目
- 已试用 Firebase SDK 6.8.0 版本
- 尝试手动添加 [FIRApp 配置]
- 没有任何效果。
为项目配置的 Firebase 控制台,包含两个具有不同 Bundle ID 的应用 android 和 iOS。安卓版经过多次测试完美运行。
Unity 编辑器版本:2019.2.20f1
Firebase Unity SDK 版本:6.10.0
正在使用的 Firebase 插件:身份验证
我们正在使用的其他 SDK(Facebook、AdMob 等):无
我们使用 Unity 编辑器的平台:Mac
我们的目标平台:iOS
脚本运行时:IL2CPP
Xcode 版本:11(最新)
CocoaPods:最新版本
【问题讨论】:
标签: ios xcode firebase unity3d authentication