Google sign in with Flutter on Android Studio - firebase

I've been looking for an answer for way too long. I am trying to implement the google sign in method with flutter and firebase so that I can access my google agenda via the google API afterwards. I get the following error: E/FirebaseInstanceId( 6925): Google Play services missing or without correct permission.
Even with the code of this video : https://www.youtube.com/watch?v=NaFI6bVI_NY&t=239s I get the error.
So you can assume my code is the same as her.
Thank you.

Most probable reason you are facing this error is because your Emulator does not have Google Play services Installed,
So try checking avd manager and see if the emulator you are running has Play Store Services installed.
You can check that by the icon like shown below:
If there is no Play Store service installed on existing emulator then create a new device having Play Store Services.

Related

codemagic distribution firebase

please can i get some help about , firebase distribution from codemagic ? When i finished building the app , i don't know why it doesn't publish himself to firebase. It always give me an error , like it show below here:
In tried to resolve the problem by trying to associate it to google play , i saw here https://support.google.com/firebase/answer/6392038 , but i am not getting even the possibility to associate , like it showing down here:
check you completed following steps:
The app is registered with your Firebase project and your Google Play developer account. This means that you have both a Firebase Android App and a Google Play app.
The app in Google Play and the Firebase Android App are both registered using the same package name.
The app in Google Play is setup on the app dashboard, and it has the following status:
The app is distributed on one of the following Google Play tracks: Internal testing, Closed testing, Open testing, or Production.
The app's review in Google Play is complete and the app is published. Your app is published if the App status column displays one of the following statuses: Internal (not Draft Internal Testing), Closed testing, Open testing, or Production.

Log errors from app on Google Play using Crashlytics

Probably silly question, but is it possible to send errors using Crashlytics from users that downloaded my app from Google Play? Until now I was using Crashlytics to collect errors from my app distributed by Firebase (so it was only for me and invited people). But I have released my app on Google Play and I can't see any errors from devices that downloaded my app in Google Play. I read that when I link my Google app with Firebase I can see purchase and subscription and analytics but no mention of Crashlytics. So my question is.. Is it even possible? Thank you very much.
Is the package name the same on your "release" version on the store? If your test one was called com.patrik.coolapp.debug (which is the default if you're using a debug build) then you'll need to add com.patrik.coolapp as an App in your Project in the Firebase console.
If you already had Crashlytics set up (all the dependencies, added the plugin, FirebaseCrashlytics.getInstance().setCrashlyticsCollectionEnabled(true) somewhere in your app) then it should just work - here's some advice on testing:
https://firebase.google.com/docs/crashlytics/test-implementation?platform=android
So I finally made it..
I'd like to thanks to #cactustictacs for help.
The problem was that I did not integrate Google Play in project settings in Firebase, although it is saying that it is just for Analytics and Subscription.
Before I integrated Google Play in Firebase I tried to add FirebaseCrashlytics.getInstance().setCrashlyticsCollectionEnabled(true) .. it did not work, but I believe it could be usefull to someone.
It wouldn't be such a problem, but it is required to have Owner or Admin permissions on both Firebase account and Google Play console account (which I did not have). After I get the permissions, integration was enabled and I could see test crashes in Crashlytics.

Error while trying to create Firebase Firestore Database

I am new to Firebase. When I am creating a new Firestore database am getting this error
Enabling Cloud Firestore will prevent you from using Cloud Datastore with this project, notably from the associated App Engine app
All solutions I found online are completely targeting experts/individual who knows their way around Firebase and Google Cloud. To me, this error is a roadblock. I tried using my other Gmail accounts, creating new projects and the same error appears. even the cancel and close buttons seen are not working I have to refresh just to get back.
Kindly help or guide me what should I do.
Based on #JoshL.Minga and #RenaudTarnec comments, the issue was narrowed down to a specific browser. After switching to Safari it didn't reproduce.
This issue has been reported to Google support.
Aside from that, you may want to try creating a Frirestore DB using a brand new project. Make sure that your new project is created via the Firebase console and not in the GCP console.

Unexpected error when querying Google Play Developer API

We have been trying to set up the sample app for Play Billing workflow with subscriptions as we are looking to introduce subscriptions in our app. We wanted to have the ClassyTaxi app running end to end in order to understand the flows better. Although for past 2 days, we are only trying to debug issues and/or missteps because of some really poor documentation on Google's front.
After ensuring every single step was correctly followed, we were able to make some progress and have the app working with the correct Skus as configured in Play Console. But now the backend server (ClassyTaxiServer) is throwing below error:
"Unexpected error when querying Google Play Developer API. Please check if you use a correct service account" - "OtherError: The project id used to call the Google Play Developer API has not been linked in the Google Play Developer Console.".
We have relooked, recreated the service account on the Cloud Console several times, but no luck.
The Play Console is correctly linked with the Google Cloud project and the access is correctly granted to the service account.
Anyone has any suggestions? How can a sample app be so difficult to set up and function as expected? Or are we doing something terribly stupid?
Please help.
Thanks.
I passed trough similar situation, and I get same issue. After checking I found a note in google documentation saying the following:
Note: As of December 1, 2019, the Google Play Developer API is available only for version 3 and higher. If you're using a lower version of the API, you must migrate to version 3 by this date. For more information on migrating to version 3, see Changes to the Google Play Developer API.
Investigating the implemented code I found that the sample uses v2 of the google API (check ./subscriptions/play-billing/PlayBilling.ts line 70). So to avoid this situation, you will need to set it to v3, and update googleapis dependency to latest version in package.json.
Additional Notes
After solving this issue, I had a different message in 'OtherError', this time is “The current user has insufficient permissions to perform the requested operation.”. I will note my solution here just someone passed through similar situation:
In google play console, and after clicking on 'Grant access' in 'API Access' tab, you will need to select the user and add some permissions to the user (in my case I set it to admin, but I think it's larger than needed), make sure also to add the app/apps you are listening to.
If the issue is still running, just edit any of your products or just try creating new one, this step will clear the google cash and refresh permissions. (Check this question).

Linking to FireBase

After following all the steps on google, after I run the emulator from scratch I get the following message:
On the google Firebase site it also tells me "Congratulations, you've successfully added Firebase to your app! ". But I am worried I did not do things properly and do not want to run in to problems later.
I do not have any problems uploading the code to the android emulator, hence I do not know if it successfully connected to Firebase. How can I properly check if I am actually indeed connected to Firebase?
If you want to check it through your code
Try getting the user by (just for the test)
await FirebaseAuth.instance.getCurrentUser()//should return null
If it throws no error everything is setup correctly
Make sure the emulator has Google play services installed

Resources