Skip to content

[Bug] Auth Unity SDK still requires Google Play Services while Android SDK does not #975

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
MohsenneChaverdie opened this issue Mar 3, 2021 · 11 comments

Comments

@MohsenneChaverdie
Copy link

MohsenneChaverdie commented Mar 3, 2021

Issue details:

  • Unity editor version: 2019.2.21f1
  • Firebase Unity SDK version: 7.1.0
  • Source you installed the SDK: unitypackage
  • Problematic Firebase Component: Auth
  • Other Firebase Components in use: Firestore
  • Platform you are using the Unity editor on: Windows
  • Platform you are targeting: Oculus Quest 2
  • Scripting Runtime: Mono

Issue description:

Trying to authenticate with Firebase through the Auth Unity package. In Unity Editor and Android with Google Services it works, however on Android devices without Google services, like Oculus Quest 2, or Emulator (No google API) does not work.
On pure Android, through Android Studio, the Authentication does not need Google play services. So why the Unity Auth Package still requires Google API?

Steps to reproduce:

Have you been able to reproduce this issue with just the Firebase Unity quickstarts (this GitHub project)? Yes. I have tried the Auth example.

What's the issue repro rate? 100%

What happened? How can we make the problem occur?
Try a simple Unity scene with authentication on an Android without Google play services. It can never authenticate itself.

On which documentation page have you seen that Google Play Services for Authentication is not required anymore?
https://firebase.google.com/docs/android/android-play-services

@chkuang-g
Copy link
Contributor

chkuang-g commented Mar 6, 2021

@MohsenneChaverdie

Could you provide the log when the device failed to authenticate? That would help us to quickly identify the issue.

I suspect it is because C++ SDK is still checking if Google Play Services is available while the Android SDK it wraps around actually does not need it anymore. See this code.

If this is the case, you should see FirebaseApp.CheckAndFixDependenciesAsync() failed.

The Android public doc said that com.google.firebase:firebase-auth:20.0.3 does not requires Google Play Service. However, Firebase Unity SDK 7.1.0 is using com.google.firebase:firebase-auth:20.0.2. I think that version probably does not require GPS either but I need to confirm with the team.

I think this is a valid bug. Thanks for reporting it.

@chkuang-g chkuang-g changed the title [Bug] Authentication from Firebase Unity SDK still needs Google Play Services even though documentation says the opposite! [Bug] Auth Unity SDK still requires Google Play Services while Android SDK does not Mar 6, 2021
@chkuang-g chkuang-g added needs-info Need information for the developer type: bug and removed new New issue. type: question labels Mar 6, 2021
@MohsenneChaverdie
Copy link
Author

@chkuang-g thank you very much for your reply.

Yes exactly. I see the FirebaseApp.CheckAndFixDependenciesAsync() fails on Android without Google Play Services.

Someone on Twitter apparently is very sure that at this time due to architectural problems, it is not possible.

@google-oss-bot google-oss-bot added needs-attention Need Googler's attention and removed needs-info Need information for the developer labels Mar 6, 2021
@chkuang-g
Copy link
Contributor

@MohsenneChaverdie Thanks for your response. I'll contact the team about this.

@chkuang-g chkuang-g removed the needs-attention Need Googler's attention label Mar 6, 2021
@StephenHodgson
Copy link

I'm also blocked by this as well.

@StephenHodgson
Copy link

I'm also curious why all of the other Firebase libraries are open source on GitHub with the exception being for the Unity one.

I'm also surprised you guys don't have a dedicated C# library that you just build the Unity packages off of

jonsimantov pushed a commit to firebase/firebase-cpp-sdk that referenced this issue Apr 12, 2021
Firebase Android SDKs for Auth, Database, Storage, Functions do not require Google Play Services anymore.
https://firebase.google.com/docs/android/android-play-services

Removing checks for Google Play services for these products from the C++ SDK. 
Tested by running integration tests on, 
- devices with Google play services (https://github.com/firebase/firebase-cpp-sdk/actions/runs/730345555)
- devices without Google Play services (tested on Kindle)
- android emulator images with and without google play services. 

Addresses firebase/quickstart-unity#975
@wimachtendink
Copy link

So, forgive my cynicism but I think a lot of people know who Stephen Hodgson is in the XR world, and it also looks like you literally just had to remove two lines of code in 4 locations.

I understand you guys are busy but this feels a little like you don't care about issues until someone important mentions it which is a pretty lame way to handle things.

I think you guys should feel a little bit of shame for how you have handled this.

@vimanyu vimanyu self-assigned this Apr 13, 2021
@StephenHodgson
Copy link

StephenHodgson commented Apr 13, 2021

@wimachtendink I am quite flattered about your remark of my value to the XR space, but it's only been a month since this issue was opened (Edit: actually it's been an issue for 2 years #223). Not too bad if these guys are running the project in their free time at work or if they have to dedicate a limited amount of hours to each project.

It could have been fixed a bit faster had this package been open source like the rest of the firebase libraries. I would have opened a PR with the fix myself lol.

Having said that, there might be some generation for swig that happens be a manual process, but could also be automated if setup correctly. I image that was the only real reason why the library isn't in GitHub.

The real fix would be providing a strictly .NET/C# library for the firebase built on top of the https://github.com/firebase/firebase-cpp-sdk and then building the unity implementation off of that.

@StephenHodgson
Copy link

Oh wait I take it back. It's been 2 years lol
#223

@wimachtendink
Copy link

Maybe I was too harsh, but a year ago they basically told everyone "Shut up about supporting Non-play services!" in #223 and then about 6 months ago (maybe less I couldn't find the release notes) they finally removed the requirement. Then, once the requirement had been removed they just didn't fix it - because they were still telling everyone to shut up and write their own REST APIs #938 which was actually the same issue as this thread.

Anyway, Issues isn't the place for ranting like this - but it makes me feel a bit like making a new issue, something like "Devs dismissive of user issues"

But I'm glad it'll finally be getting fixed.

@vimanyu
Copy link
Contributor

vimanyu commented Apr 14, 2021

Thanks for your patience everyone. I am closing this ticket and this will go out in the next release. Please note that the fix is on the C++ side but we will have to wait until the next Unity release for the Unity plugins to support this.

@vimanyu vimanyu closed this as completed Apr 14, 2021
@StephenHodgson
Copy link

@vimanyu do you have any ETA when the next release would go out? Do you guys have a regular cadence you follow?

TBH I usually only follow release notifications on GitHub, but this library isn't in GitHub like the rest of the firebase libraries.

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

No branches or pull requests

6 participants