Skip to content

[Bug] "Unavailable invalid" FirebaseAuth for Unity on Quest 2 #1074

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

Closed
lremor opened this issue Jul 19, 2024 · 11 comments
Closed

[Bug] "Unavailable invalid" FirebaseAuth for Unity on Quest 2 #1074

lremor opened this issue Jul 19, 2024 · 11 comments
Assignees
Labels

Comments

@lremor
Copy link

lremor commented Jul 19, 2024

Description

I'm having trouble starting Firebase on Meta Quest 2. The app builds without errors and the message that should appear in the
FirebaseAuth dependencyStatus is: "available". However, when starting it on Quest 2, the following message appears: "unavailable invalid"

"Available" status occurs normally on Windows, Unity editor and Android phone. Does anyone know why this error occurs on Quest 2?

I tried rewriting the code, reinstalling the SDKs, setting up another Firebase account, checked the package name, checked Google services, tried options related to internet connection.

Reproducing the issue

Follow the code:

async void Start() { Debug.Log("Checking dependencies"); await FirebaseApp.CheckAndFixDependenciesAsync().ContinueWithOnMainThread(task => { dependencyStatus = task.Result; }); Debug.Log("Logging"); var auth = FirebaseAuth.DefaultInstance; await auth.SignInAnonymouslyAsync(); Debug.Log("Logged!"); auth.SignOut(); Debug.Log("Unlogged!"); }

Firebase Unity SDK Version

12.1.0

Unity editor version

24f1.3.2022

Installation Method

.unitypackage

Problematic Firebase Component(s)

Authentication

Other Firebase Component(s) in use

No response

Additional SDKs you are using

Nothing, only FirebaseAuth

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

No response

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

No

@lremor lremor added new New issue. type: bug labels Jul 19, 2024
@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.

@argzdev
Copy link

argzdev commented Jul 23, 2024

Hey @lremor , thanks for reaching out. For context, there's an issue with Firebase SDK version 12.1.0. There are breaking changes in Firebase Android SDK which requires compileSdkVersion 34 (Start on Firebase Unity SDK version 12.0.0 onwards).

Breaking change: Changed the required minimum compileSdkVersion to be 34 or higher.
Breaking change: Updated minSdkVersion to API level 21 or higher.

Now according to the Unity forums, Unity Editors currently do not support compileSdkVersion 34, and is currently being worked on by their engineers. There are workarounds, by the Unity engineer, however I haven't tried it myself.

While waiting for Unity to fix the version to support compileSdkVersion 34, one mitigation solution would be to downgrade Firebase SDK version 11.9.0 and also lower your compileSdkVersion to 33 or lower.

There's also another solution shared by our developers, which I was able to verify that it works for Android emulators version 14. Though, given that we don't have any Quest 2 lying around, I'm unable to verify if this works.

Export the Unity project to Android Studio, change Gradle and AGP version to 8+. (This page says Android 34 requires AGP 8.1.1+).
Change min SDK from 23 to 24.

Let me know if these changes works. Thanks!

@argzdev argzdev added the needs-info Need information for the developer label Jul 23, 2024
@argzdev argzdev self-assigned this Jul 23, 2024
@lremor
Copy link
Author

lremor commented Jul 23, 2024

Hey , obrigado por estender a mão. Para contextualizar, há um problema com a versão do SDK do Firebase. Há mudanças significativas no Firebase Android SDK que requer compileSdkVersion 34 (Iniciar no Firebase Unity SDK versão em diante).12.1.0``12.0.0

Alteração de quebra: Alterado o mínimo necessário compileSdkVersion para 34 ou superior. Alteração de ruptura: Atualizado minSdkVersion para API nível 21 ou superior.

Agora, de acordo com os fóruns Unity, Unity Editors atualmente não suporta compileSdkVersion 34, e está atualmente sendo trabalhado por seus engenheiros. Existem soluções alternativas, pelo engenheiro Unity, no entanto, eu mesmo não tentei.

Enquanto espera que o Unity corrija a versão para suportar compileSdkVersion 34, uma solução de mitigação seria fazer o downgrade da versão do SDK do Firebase e também reduzir seu compileSdkVersion para 33 ou inferior.11.9.0

Há também outra solução compartilhada por nossos desenvolvedores, que pude verificar se funciona para emuladores Android versão 14. No entanto, dado que não temos nenhum Quest 2 por aí, não consigo verificar se isso funciona.

Exporte o projeto Unity para o Android Studio, altere a versão do Gradle e AGP para 8+. (Esta página diz que o Android 34 requer AGP 8.1.1+). Altere o SDK mínimo de 23 para 24.

Deixe-me saber se essas mudanças funcionam. Obrigado!

Hello, thanks for the answer, I tested with compileSDKVersion 33 but a build error occurs in the Android Gradle Plugin:

This warning can be suppressed by adding 
    android.suppressUnsupportedCompileSdk=33
to this project's gradle.properties
The build will continue, but you are strongly encouraged to update your project to use a newer Android Gradle Plugin that has been tested with compileSdk = 33 
 Task :launcher:preBuild UP-TO-DATE
 Task :unityLibrary:preBuild UP-TO-DATE
 Task :launcher:preDebugBuild UP-TO-DATE
 Task :unityLibrary:preDebugBuild UP-TO-DATE
 Task :launcher:mergeDebugNativeDebugMetadata NO-SOURCE
 Task :unityLibrary:compileDebugAidl NO-SOURCE
 Task :unityLibrary:packageDebugRenderscript NO-SOURCE
 Task :launcher:generateDebugBuildConfig UP-TO-DATE
 Task :unityLibrary:writeDebugAarMetadata UP-TO-DATE
 Task :launcher:compileDebugAidl NO-SOURCE
 Task :unityLibrary:compileDebugRenderscript NO-SOURCE
 Task :launcher:compileDebugRenderscript NO-SOURCE
 Task :unityLibrary:generateDebugResValues UP-TO-DATE
 Task :unityLibrary:generateDebugResources UP-TO-DATE
 Task :launcher:javaPreCompileDebug UP-TO-DATE
 Task :unityLibrary:packageDebugResources UP-TO-DATE
 Task :unityLibrary:extractDeepLinksDebug UP-TO-DATE
 Task :unityLibrary:compileDebugLibraryResources UP-TO-DATE
 Task :unityLibrary:parseDebugLocalResources UP-TO-DATE
 Task :unityLibrary:generateDebugBuildConfig UP-TO-DATE
 Task :unityLibrary:javaPreCompileDebug UP-TO-DATE
 Task :unityLibrary:mergeDebugShaders UP-TO-DATE
 Task :unityLibrary:compileDebugShaders NO-SOURCE
 Task :unityLibrary:generateDebugAssets UP-TO-DATE
 Task :unityLibrary:packageDebugAssets UP-TO-DATE
 Task :unityLibrary:processDebugJavaRes UP-TO-DATE
 Task :unityLibrary:processDebugManifest
 Task :unityLibrary:bundleLibResDebug UP-TO-DATE
 Task :unityLibrary:mergeDebugJniLibFolders UP-TO-DATE
 Task :unityLibrary:mergeDebugNativeLibs UP-TO-DATE
 Task :unityLibrary:copyDebugJniLibsProjectOnly UP-TO-DATE
 Task :launcher:generateDebugResValues UP-TO-DATE
 Task :launcher:generateDebugResources UP-TO-DATE
 Task :launcher:checkDebugAarMetadata FAILED
 Task :launcher:mergeDebugResources UP-TO-DATE
 Task :unityLibrary:generateDebugRFile 22 actionable tasks: 3 executed, 19 up-to-date 
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

So, do I need to downgrade my version of Unity? If so, what would be the correct version?

@google-oss-bot google-oss-bot added needs-attention Need Googler's attention and removed needs-info Need information for the developer labels Jul 23, 2024
@argzdev
Copy link

argzdev commented Jul 23, 2024

You have to downgrade Firebase Unity SDK to version 11.9.0, not the Unity Editor. Let me know if this works. Thanks!

@argzdev argzdev added needs-info Need information for the developer and removed needs-attention Need Googler's attention labels Jul 23, 2024
@lremor
Copy link
Author

lremor commented Jul 23, 2024

You have to downgrade Firebase Unity SDK to version 11.9.0, not the Unity Editor. Let me know if this works. Thanks!

Hello, I changed the SDK version of firebase auth to 11.9.0, I also changed the gradle properties to:

        minSdkVersion 23
        targetSdkVersion 32
        compileSdkVersion 33

However, the error only persists on Quest 2, like the image below:
unavailableinvalid

@google-oss-bot google-oss-bot added needs-attention Need Googler's attention and removed needs-info Need information for the developer labels Jul 23, 2024
@argzdev
Copy link

argzdev commented Jul 24, 2024

Have you tried the solution from this thread shared by our developers?

If that doesn't work, could you try downgrading to version 11.6.0 for Firebase Auth?

@lremor
Copy link
Author

lremor commented Jul 25, 2024

Hi again. I have already tested with the updated version (for Unity) of the FirebaseAuth SDK 12.1 (API Level 34, 33), and with 11.9.0 (API Level 32) and 11.6.0 (API Level 31). The dependencyStatus keeps showing "Unavailable invalid" The strange thing is that it works on windows, unity editor and android phone. Doesn't just work on Quest 2. Now I will try export the Unity project to Android Studio, btw I would appreciate it if you have another opinion

@argzdev
Copy link

argzdev commented Jul 26, 2024

Thanks for the updates, @lremor. Sorry, I'm not sure what the issue is. Do you have any logs or stacktrace to share with us so we can investigate this further?

@argzdev argzdev added needs-info Need information for the developer and removed needs-attention Need Googler's attention labels Jul 26, 2024
@lremor
Copy link
Author

lremor commented Jul 29, 2024

Thanks for the updates, @lremor. Sorry, I'm not sure what the issue is. Do you have any logs or stacktrace to share with us so we can investigate this further?

Hello again, we finally solved the problem! Although the application is for Android, all you had to do was install the IOS support build on Unity for Firebase to work and be available!
In build.gradle it was used:

        minSdkVersion 23
        targetSdkVersion 33
        compileSdkVersion 34

and it worked. Thanks for helping

@google-oss-bot google-oss-bot added needs-attention Need Googler's attention and removed needs-info Need information for the developer labels Jul 29, 2024
@lremor lremor closed this as completed Jul 29, 2024
@lremor
Copy link
Author

lremor commented Jul 29, 2024

Its working now.

@argzdev
Copy link

argzdev commented Jul 30, 2024

Glad to hear it's working, thanks for the update!

@firebase firebase locked and limited conversation to collaborators Aug 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants