Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Failed to read user data for app (__FIRAPP_DEFAULT). #1148

Open
MephestoKhaan opened this issue Nov 14, 2024 · 4 comments
Open

[Bug] Failed to read user data for app (__FIRAPP_DEFAULT). #1148

MephestoKhaan opened this issue Nov 14, 2024 · 4 comments

Comments

@MephestoKhaan
Copy link

MephestoKhaan commented Nov 14, 2024

Description

Hey there, I upgraded my Meta Quest Unity Project from using Firebase 10.5 to 12.3 and 12.4 recently and now Auth totally hangs in the
SignInWithEmailAndPasswordAsync call.

This just happens in my Windows Editor, not in Android Build. And surprisingly this does not happens (same repo and everything) in my Mac Editor (connected to the same network).

I have tried with #1048, and also the VPN solution suggested in #1098.
I have also tried nuking the Library and Temp folders.

I have been using this project for a few years now, and never had trouble.

Reproducing the issue

Open Unity in Windows.
Check Firebase Dependencies.
Initialize Firebase.

The console will output:

Failed to read user data for app (__FIRAPP_DEFAULT). This could happen if the current user doesn't have access to the keystore, the keystore has been corrupted or the app intentionally deleted the stored data.

Call SignInWithEmailAndPasswordAsync.
It will never finish that async call.

After stopping Unity I get:

SignInWithEmailAndPasswordAsync encountered an error: System.AggregateException: One or more errors occurred. (An internal error has occurred.) ---> Firebase.FirebaseException: An internal error has occurred.
  at Firebase.Auth.FirebaseAuth.SignInWithEmailAndPasswordAsync (System.String email, System.String password) [0x00038] in /Users/runner/work/firebase-unity-sdk/firebase-unity-sdk/android_unity/armeabi-v7a/auth/swig/Firebase.Auth_fixed.cs:3840 
   --- End of inner exception stack trace ---
---> (Inner Exception #0) Firebase.FirebaseException: An internal error has occurred.
  at Firebase.Auth.FirebaseAuth.SignInWithEmailAndPasswordAsync (System.String email, System.String password) [0x00038] in /Users/runner/work/firebase-unity-sdk/firebase-unity-sdk/android_unity/armeabi-v7a/auth/swig/Firebase.Auth_fixed.cs:3840 <---

Firebase Unity SDK Version

12.3.0

Unity editor version

2022.3.51

Installation Method

Unity Package Manager

Problematic Firebase Component(s)

Authentication

Other Firebase Component(s) in use

Analytics, Crashlytics, Firestore, Functions

Additional SDKs you are using

No response

Targeted Platform(s)

Android

Unity editor platform

Windows

Scripting Runtime

IL2CPP

Release Distribution Type

Pre-built SDK from https://firebase.google.com/download/unity

Relevant Log Output

Failed to read user data for app (__FIRAPP_DEFAULT). This could happen if the current user doesn't have access to the keystore, the keystore has been corrupted or the app intentionally deleted the stored data.

If using CocoaPods for Apple platforms, the project's Podfile.lock

Expand Podfile.lock snippet
👀 Replace this line with the contents of your Podfile.lock!
@google-oss-bot
Copy link

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

@MephestoKhaan
Copy link
Author

I fixed my problem!
/cc zxt385189207

For some reason USE_AUTH_EMULATOR was lingering in my Environment Variables. So it was trying to connect to the emulator.

In the past I was doing:
System.Environment.SetEnvironmentVariable("USE_AUTH_EMULATOR", null); to remove this entry from the Windows Enviroment variables and System.Environment.SetEnvironmentVariable("USE_AUTH_EMULATOR", "true"); to enable it.

But for some reason, null is now just setting it to 0, not removing it. And I believe Firebase simply checks if the variable exists and does not care about the value.

image

Maybe something has changed in the C# implementation since I upgraded to Unity 2022 recently?

If you think this might be your problem, don't forget to Sign-out from Windows after changing the Environment Variables to ensure they get applied,.

@MephestoKhaan
Copy link
Author

That said @argzdev it would be great if the Logs showed where are they trying to connect. I could not find any relevant log.

Failed to read user data for app (__FIRAPP_DEFAULT). This could happen if the current user doesn't have access to the keystore, the keystore has been corrupted or the app intentionally deleted the stored data.

This one simply refers to the current logged user not being valid, it is not related to the error at all, after all.

@argzdev
Copy link

argzdev commented Nov 15, 2024

Hey @MephestoKhaan, thanks for reaching out. That's interesting, yeah I do believe our logs should show more details regarding connectivity especially if it's using the emulator or not. We'll try and work something out in the future. I'll reopen this and change it into a feature request instead. Thank you for the detailed explanation, really appreciated it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants