Skip to content
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

Problem with com.google.gms:google-services:4.1.0 #1445

Closed
MacNakrub opened this issue Sep 13, 2018 · 22 comments
Closed

Problem with com.google.gms:google-services:4.1.0 #1445

MacNakrub opened this issue Sep 13, 2018 · 22 comments

Comments

@MacNakrub
Copy link

Step 1: Are you in the right place?

Maybe.

Step 2: Describe your environment

  • Android device: Emulator
  • Android OS version: O
  • Google Play Services version: 4.1.0
  • Firebase/Play Services SDK version:
    implementation 'com.google.firebase:firebase-core:16.0.3'
    implementation 'com.google.firebase:firebase-auth:16.0.3'
    implementation 'com.google.firebase:firebase-perf:16.1.0'
    implementation 'com.google.firebase:firebase-database:16.0.2'
    implementation 'com.google.firebase:firebase-firestore:17.1.0'
    implementation 'com.google.firebase:firebase-invites:16.0.3'
    implementation 'com.google.firebase:firebase-messaging:17.3.1'

    implementation 'com.google.android.gms:play-services-auth:16.0.0'
    implementation 'com.google.android.gms:play-services-maps:15.0.1'
    implementation 'com.google.android.gms:play-services-vision:15.0.2'
  • FirebaseUI version: both 4.1.0 and 4.2.0
   implementation "com.firebaseui:firebase-ui-auth:4.2.0"
   implementation "com.firebaseui:firebase-ui-storage:4.2.0"

Step 3: Describe the problem:

When change the version of com.google.gms:google-services from 4.0.x to 4.1.0

Steps to reproduce:

  1. Start app with google-services version 4.0.2. It's working fine.
  2. Change google-services version 4.1.0, sync and run
  3. Crash
  4. Adding FirebaseApp.initializeApp(applicationContext) won't help

Observed Results:

2018-09-13 17:49:12.515 27842-27842/xxx.xxxxxxx E/AndroidRuntime: FATAL EXCEPTION: main
    Process: xxx.xxxxxxx, PID: 27842
    java.lang.RuntimeException: Unable to create application xxx.xxxxxxx.MainApplication: java.lang.IllegalStateException: Default FirebaseApp is not initialized in this process xxx.xxxxxxx. Make sure to call FirebaseApp.initializeApp(Context) first.
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5743)
        at android.app.ActivityThread.-wrap1(Unknown Source:0)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1656)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:164)
        at android.app.ActivityThread.main(ActivityThread.java:6494)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
     Caused by: java.lang.IllegalStateException: Default FirebaseApp is not initialized in this process xxx.xxxxxxx. Make sure to call FirebaseApp.initializeApp(Context) first.
        at com.google.firebase.FirebaseApp.getInstance(com.google.firebase:firebase-common@@16.0.2:240)
        at com.google.firebase.firestore.FirebaseFirestore.getInstance(com.google.firebase:firebase-firestore@@17.0.5:49)
        at xxx.xxxxxxx.MainApplication.onCreate(MainApplication.kt:57)
        at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1119)
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5740)
        at android.app.ActivityThread.-wrap1(Unknown Source:0) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1656) 
        at android.os.Handler.dispatchMessage(Handler.java:106) 
        at android.os.Looper.loop(Looper.java:164) 
        at android.app.ActivityThread.main(ActivityThread.java:6494) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807) 

Expected Results:

App won't crash and start normally

Relevant Code:

class MainApplication : Application() {
override fun onCreate() {
      super.onCreate()
     ...

     // Adding `FirebaseApp.initializeApp(applicationContext)` here won't help
      val settings = FirebaseFirestoreSettings.Builder()
              .setTimestampsInSnapshotsEnabled(true)
              .build()
      val firestore = FirebaseFirestore.getInstance()
      firestore.firestoreSettings = settings
  }
}
@samtstern
Copy link
Contributor

@MacNakrub there is a known issue where google-services 4.1.0 does not work with the latest versions of the Android Gradle Plugin (mostly 3.3.0-alpha0x). We are working on it!

Going to close this issue, we're tracking it elsewhere.

@AndroidGecko
Copy link

@samedson could you ref issue where this is being tracked, thanks!

@samtstern
Copy link
Contributor

@AndroidGecko it's being tracked internally, so if I gave you a link it wouldn't work for you ... sorry for the lack of transparency

@kanetik
Copy link

kanetik commented Oct 20, 2018

Can we get some indication of when we might see this fixed? Days, weeks, months?

@eygraber
Copy link

Now that 3.3 is in beta, can we get some more information about this? Very difficult to test out the alphas and betas (as the AS team suggests frequently) if Google's own tools don't work with them.

@samtstern
Copy link
Contributor

Sorry I don't have a timeline yet, please keep using google-services:4.0.1 for now

@johncodeos
Copy link

This thing haven't been fixed yet?
I want to update to 3.3 beta 3 because they have fixed the problem with the sound when you have open the emulator and you use bluetooth headphones.

@samtstern
Copy link
Contributor

Have you tried version 4.2.0 of the google-services plugin?

@plastiv
Copy link

plastiv commented Nov 19, 2018

@samtstern Where release notes could be found for 4.2.0?

Is it possible to add link to a changelog page here? https://developers.google.com/android/guides/google-services-plugin

@kungufli
Copy link

kungufli commented Dec 4, 2018

com.google.gms:google-services:4.2.0 works as expected, thanks.

@Pitel
Copy link

Pitel commented Dec 10, 2018

> Could not resolve all artifacts for configuration ':classpath'.
   > Could not find com.google.gms:google-services:4.2.0.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/com/google/gms/google-services/4.2.0/google-services-4.2.0.pom
       - https://dl.google.com/dl/android/maven2/com/google/gms/google-services/4.2.0/google-services-4.2.0.jar
       - https://jcenter.bintray.com/com/google/gms/google-services/4.2.0/google-services-4.2.0.pom
       - https://jcenter.bintray.com/com/google/gms/google-services/4.2.0/google-services-4.2.0.jar
       - https://maven.fabric.io/public/com/google/gms/google-services/4.2.0/google-services-4.2.0.pom
       - https://maven.fabric.io/public/com/google/gms/google-services/4.2.0/google-services-4.2.0.jar

@danallen88
Copy link

> Could not resolve all artifacts for configuration ':classpath'.
   > Could not find com.google.gms:google-services:4.2.0.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/com/google/gms/google-services/4.2.0/google-services-4.2.0.pom
       - https://dl.google.com/dl/android/maven2/com/google/gms/google-services/4.2.0/google-services-4.2.0.jar
       - https://jcenter.bintray.com/com/google/gms/google-services/4.2.0/google-services-4.2.0.pom
       - https://jcenter.bintray.com/com/google/gms/google-services/4.2.0/google-services-4.2.0.jar
       - https://maven.fabric.io/public/com/google/gms/google-services/4.2.0/google-services-4.2.0.pom
       - https://maven.fabric.io/public/com/google/gms/google-services/4.2.0/google-services-4.2.0.jar

Seeing the same for 4.1.0.

@anton-klimov
Copy link

anton-klimov commented Dec 10, 2018

The same issue for 4.1.0 and 4.2.0. It worked today. But now it isn't. I can't download any version

> Could not resolve all artifacts for configuration ':classpath'.
   > Could not find com.google.gms:google-services:4.1.0.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/com/google/gms/google-services/4.1.0/google-services-4.1.0.pom
       - https://dl.google.com/dl/android/maven2/com/google/gms/google-services/4.1.0/google-services-4.1.0.jar
       - https://jcenter.bintray.com/com/google/gms/google-services/4.1.0/google-services-4.1.0.pom
       - https://jcenter.bintray.com/com/google/gms/google-services/4.1.0/google-services-4.1.0.jar
       - https://maven.fabric.io/public/com/google/gms/google-services/4.1.0/google-services-4.1.0.pom
       - https://maven.fabric.io/public/com/google/gms/google-services/4.1.0/google-services-4.1.0.jar
       - https://plugins.gradle.org/m2/com/google/gms/google-services/4.1.0/google-services-4.1.0.pom
       - https://plugins.gradle.org/m2/com/google/gms/google-services/4.1.0/google-services-4.1.0.jar
     Required by:
         project :

@mediadeo
Copy link

for nativescripters using nativescript-plugin-firebase check EddyVerbruggen/nativescript-plugin-firebase#1072

@andresserranoglb
Copy link

andresserranoglb commented Dec 10, 2018

Hi @MacNakrub @danallen88 and @Pitel I was getting the same issue, according to the documentation (https://mvnrepository.com/artifact/com.google.gms/google-services/4.2.0) the artifact is located on https://dl.bintray.com/android/android-tools/ so I added to the build.gradle maven { url 'https://dl.bintray.com/android/android-tools' } and now it`s working well

@samtstern
Copy link
Contributor

Hey all there's an ongoing issue with the Google Maven repo (google() or maven.google.com) so if you're having trouble with your dependencies today, that's the reason. It doesn't have anything to do with FirebaseUI so please refrain from adding more comments here.

@dluksza
Copy link

dluksza commented Mar 16, 2019

I'm getting this error with google-services 4.2.0 and android gradle plugin 3.3.2

@permadanis
Copy link

its a typo on firebase documentation.
the correct code is

com.google.gms.google-services.4.1.0

replace the colon : with dot .

@lilfolr
Copy link

lilfolr commented Apr 14, 2019

I think mean it should be:
classpath 'com.google.gms:google-services:4.1.0'
Edit: Well that worked for me anyway :)

@juliusMinimalist
Copy link

Hi, I have the same issue even if I change version to
classpath 'com.google.gms:google-services:4.1.0'
Need Hepl plz !
image

@webumer
Copy link

webumer commented Oct 27, 2019

Change this to
classpath 'com.google.gms:google-services:4.3.2'
work for me

@bcamposq1995
Copy link

Android studio error: JAVA_LETTER_OR_DIGIT when changed to com.google.gms:google-services:4.3.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests