Setting up Firebase with android studio for authentication - java

I am trying to setup my android project with Firebase so that I can allow users to login and sign up for my app.
I have connected my app to Firebase but when I try and add Firebase Authentication to my app I get the following error:
The library com.google.android.gms:play-services-base is being
requested by various other libraries at [[15.0.1,15.0.1]], but
resolves to 16.0.1. Disable the plugin and check your dependencies
tree using ./gradlew :app:dependencies.

Try updating both all the Play Services and Firebase libraries to the latest version. For more information take a look at https://developers.google.com/android/guides/releases#may_23_2018
Hopefully this helps!

Related

Cannot redeploy GCP App Engine project after restoring it

I created a GCP App Engine (AE) project using Java 11. Once the AE project was created, I then linked it to Firebase (as opposed to creating natively through Firebase to begin with). Everything worked fine.
Today I deleted the Firebase account thinking it would keep original AE project, since I thought it was simply an add-on to my core AE project. I was wrong. Both the AE project and the Firebase account were deleted. I restored both through the GCP admin screen and the site came back up (both the AE project and Firebase functionality).
The problem now is that I can't deploy new versions of my code with gcloud app deploy. The build logs (on GCP's end) list the following error:
Step #3 - "analyzer": Already have image (with digest): us.gcr.io/gae-runtimes/buildpacks/java11/builder:java11_20200816_11_0_RC00
Step #3 - "analyzer": ERROR: failed to initialize cache: failed to create image cache: accessing cache image "us.gcr.io/my-project-dev-287623/app-engine-tmp/build-cache/ttl-7d/default/buildpack-cache:latest": connect to repo store 'us.gcr.io/my-project-dev-287623/app-engine-tmp/build-cache/ttl-7d/default/buildpack-cache:latest': GET https://us.gcr.io/v2/my-project-dev-287623/app-engine-tmp/build-cache/ttl-7d/default/buildpack-cache/manifests/latest: DENIED: Permission denied for "latest" from request "/v2/my-project-dev-287623/app-engine-tmp/build-cache/ttl-7d/default/buildpack-cache/manifests/latest".
Now I'm locked out from deploying any new code. Any ideas?
This issue was resolved when I enabled billing for my account. Please check if you have billing enabled/linked billing account for your project.
I want to point out a misunderstanding in your question, I forgot to mention it in my first message. There is NO link GCP project to the Firebase project. Firebase project IS a Google Cloud project. That is why when you delete the Firebase project, the GCP project gone. it is intended behavior. The way you mean link, it is actually to add Firebase services to the current GCP project
It is certain that the permission error. You need to grant permission to the docker. Also it may caused by the ' Cloud Build API', checked if ' Cloud Build API' has been enabled and try to disable it and then enable it. It may help. Let me know if the issue continues
If your billing and Build API are enabled please check this. After the end of the trial period, Google asks to Upgrade account to enable its services. Google shows a notification bar to do it on top of the Cloud Console.
Due to payment failure in my case. There was a pending payment of $0.01 for previous month & payment failed as the minimum payment is $10. I have paid $10 in advance & working fine.

Firebase UI authentication with google fails with message (code:10 message:10)

I've made a chat app that uses Firebase's feature Real-time database.
I face a problem with google authentication. The problem started when I downloaded the app from the Play Store, the authentication was working perfectly when I was running the app in debug mode. When users try to sign in they get a toast message code:10 message:10.
I would like to note here that: I've added the SHA1 fingerprint. How can I solve this?
*Not sure if this is helpful but I've followed step by step this tutorial
You need three keys in order to make it work:
The debug key. Informations here.
The release key. Informations here.
Google Play App signing key. Informations here.
All these keys are needed in order to make the sign-in process work.
Other informations here.
After generating SHA1 for release key, I forgot downloading the new google-service.json file that caused the same error.
Make sure you follow the instruction https://developers.google.com/android/guides/client-auth to generate and add debug/release SHA1 to firebase console and download google-service.json after updated.
If you use Use app signing by Google Play option, you need an additional step:
After uploading app into google play console, go to Release management > App signing, copy SHA1 and paste to firebase console
Update
In the new google play console, the App signing key can be found as following:
Setup > App signing
Make sure you have added signed SHA1. If you are using debug one then it will not gonna work for live apk.
You need to put "debug.keystore" in this path C:\Users\USER_FOLDER_NAME.android
then in Android studio follow the below steps
1. Run your project
2. Click on Gradle menu
3. Expand Gradle Tasks tree
4. Double click on android -> signingReport
You can see SHA in Run Tab
for more information see link
For me the problem was that i registered app and enabled google signin on Firebase console but I was testing with the debug version of app which has slightly different package name (same name but ended with .debug) so it was not working because the debug app is not yet registered. so additionally to my release app i also added the debug app to the firebase project for the app and it generated it's own google-services.json which i download and set to src/debug/google-services.json.
I believe this might be useful to some one else.

How do I update Google Play Services on Android Studio?

I have changed the dependencies and installed the necessary files needed. However, whenever I run my emulator, a message with pop up saying that I have to update my Google Play Services. Any idea on how to solve this problem?
Go to settings from file and update the Google Play services from the SDK manager:

How to install Android GCM

I can't find a way to install the Android GCM through the SDK Manager. I have managed to install the play services but in the extras folder I can't find the GCM.jar library. The GCM is not listed in the SDK Manager checkboxes although I have made all the possible updates
You don't need GCM.jar. Only PlayServices library is required.
Refer: http://developer.android.com/google/gcm/gs.html
There is only Google Play Services you need to setup. Implementing GCM Client is the complete source code, given by android documentation .

Google Wallet API miss in google-play-services

I try use Google Wallet API in my own app. I update my Eclipse and SDK to latest version. I try start example from google https://developers.google.com/commerce/wallet/instant-buy/android/resources/instant-buy-android-sample.zip with last google-play-services.jar (file size 632030).
But I get error:
The import com.google.android.gms.wallet cannot be resolved
because in jar-file miss wallet folder.
Where I can get last google-play-services.jar with wallet?
The library is not the one which can be downloaded from android sdk
you have to submit request by filling a form for now.
In wallet tutorial they have mentioned it
Important: To run Instant Buy for Android API samples, you'll need to
download Google Play Services second-party libraries and include them
in your development project. If you don't already have a Google
contact to provide access for you, submit the Instant buy interest
form. Google will respond to qualified merchants with instructions on
how to get the required libraries and credentials.
link is here

Categories