Reputation: 49
I'm trying to connect my Android APP with Firebase, these are something I've already tried and checked.
A. Connected from Firebase console and doing the SDK set up.
1.The Package name, SHA1 in Firebase console are correct.
2.Latest version of google-services.json file and placed it in app.
3.The package names in google-services.json are correct.
4.The dependency in the app level gradle with plugin
implementation 'com.google.firebase:firebase-core:16.0.4'
apply plugin: 'com.google.gms.google-services'
5.The dependency in project level classpath 'com.google.gms:google-services:4.0.1'
6.Latest version of Google Play Services and Google Repository in SDK Manager.
7.Uninstall the APP and run again.
The problem occurred at the forth step, checking the connection with a continuous progress bar but unable to connect.
B. Connect from Android studio assistant
The dialog showed "This app is already connected to a project "SampleProject".Click "Sync" to update the configuration information."
After Sync, the Event Log showed
Firebase: Couldnt find keystore in file ({0}) specified for release build type. {2}
Firebase: Firebase project created and connected locally to module: app.
I'm not sure whether the problem occurred here or not, is there any other options to resolve this problem? Many Thanks!
update
After struggling on this problem for one day, the problem doesn't solved, but I used a tricky way to avoid the problem. Connected my APP with Fabric crashlytics rather than connect with Firebase directly, then connect Firebase with Fabric. The process would be APP->Fabric->Firebase. May the alternative way help someone facing similar problem.
Upvotes: 1
Views: 4470
Reputation: 1713
A possible problem may be with
5.The dependency in project level classpath 'com.google.gms:google-services:4.0.1'
Try using 'com.google.gms:google-services:4.1.0'
Something else that you can try is changing
implementation 'com.google.firebase:firebase-core:16.0.4'
to implementation 'com.google.firebase:firebase-core:16.0.3'
Also, check to make sure that
apply plugin: 'com.google.gms.google-services'
is at the bottom of your app level build.gradle file.
Another problem may be that your google-services.json file is in the wrong location. Make sure that in Android Studio, it looks like this for you:
Hopefully, this should fix your problems. If it doesn't please post a screenshot of the place where you think it is not working.
Upvotes: 1
Reputation: 21
Latest version of google-services.json file and placed it in app. ???
after you downloaded it from the fire-base project settings and after you added it to your project. Did you made rebuild project from the android studio build menu or not ?
Upvotes: 1