Reputation: 11
I am trying to make Firebase Unity SDK work on iOS 13 device. I was able to build the project, but the issue is I am not able sign up or authenticate user.
Steps to Reproduce: (What I did)
What I see in Xcode project:
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
Signed and build on my iPhone 8 with iOS 13.
Result: When I try to fill fields email and password and push button "Create User" which calls the method:
// 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();
}
I see this error on device screen and in Xcode logs too:
AuthError.Failure: Firebase.FirebaseException: An internal error has occurred, print and inspect the error details for more information.
Here is full log from Xcode:
https://drive.google.com/file/d/1ZQzrA67NXqM-lwNsSqT8Dgam9XiSHD9y/view?usp=sharing
Also I tried to do:
Firebase console configured for project and contains two apps android and iOS with different Bundle IDs. Android version works perfect tested many time.
Unity editor version: 2019.2.20f1
Firebase Unity SDK version: 6.10.0
Firebase plugins in use: Auth
Additional SDKs we are using (Facebook, AdMob, etc.): None
Platform we are using the Unity editor on: Mac
Platform we are targeting: iOS
Scripting Runtime: IL2CPP
Xcode version: 11 (the latest)
CocoaPods: The latest version
Upvotes: 0
Views: 1654
Reputation: 1042
I was seeing "CreateUserWithEmailAndPasswordAsync encountered an error: System.AggregateException: An internal error has occurred." in the Unity console.
To fix, I closed Unity, committed my important changes, and re-opened Unity. In the pop-up that appeared, I clicked "Enable".
Meanwhile, I also went to my project settings in the Firebase console (https://console.firebase.google.com/project/myprojectname/authentication/providers) and enabled mail signup. It is also advised in the video tutorial, but not in the written one. Firebase Official Video Tutorial
After that, problem got solved.
Upvotes: 0
Reputation: 11
At least I was able to fix the problem. Here is the description how I fixed it.
As I mentioned above Unity was exporting PodFile like this:
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
So this means Firebase Unity SDK 6.10.0 requires Pods version 6.14.0. Building with this pods I was seeing error mentioned above:
[SA LOG] CreateUserWithEmailAndPasswordAsync encountered an error: System.AggregateException: One or more errors occurred. ---> System.AggregateException: One or more errors occurred. ---> Firebase.FirebaseException: An internal error has occurred, print and inspect the error details for more information.
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
---> (Inner Exception #0) System.AggregateException: One or more errors occurred. ---> Firebase.FirebaseException: An internal error has occurred, print and inspect the error details for more information.
--- End of inner exception stack trace ---
---> (Inner Exception #0) Firebase.FirebaseException: An internal error has occurred, print and inspect the error details for more information.<---
<---
As you can see this error says nothing.
After doing long research I noticed in CocoaPods website there are newer versions for Firebase pods available so I changed my PodsFile like this manually and installed Pods using terminal:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
target 'Unity-iPhone' do
pod 'FirebaseAnalytics', '~> 6.2'
pod 'FirebaseAuth', '~> 6.4'
pod 'FirebaseCore', '~> 6.6'
end
After building I was able to get human readable error which says:
Response body: {
"error": {
"code": 400,
"message": "API key expired. Please renew the API key.",
"status": "INVALID_ARGUMENT",
"details": [
{
"@type": "type.googleapis.com/google.rpc.Help",
"links": [
{
"description": "Google developer console API key",
"url": "https://console.developers.google.com/project/37062923653/apiui/credential"
}
]
}
]
}
}
I updated API key in Google Developer Console as error says and now everything works well.
Conclusion:
This wasn't issue related to Firebase Unity SDK 6.10.0 and nor 6.8.0, and also this wasn't related to Parse DLLs. Just the problem was the older versions 6.14.0 for Firebase Pods not giving human readable error, so I wasn't able to understand what was going on. After using latest Firebase Pods I was able to understand error reason.
Thanks everyone who responded to my problem.
Upvotes: 1