Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FCM Notification : Failed to initialize

I am new to firebase and I want to implement Firebase Cloud Messaging(FCM) I am facing problem getting started with it. The firebase is not initializing. Thanks for helping.

build.gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.1.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
        classpath 'com.google.gms:google-services:3.0.0'
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

build.gradle (app)

apply plugin: 'com.android.application'

android {
    compileSdkVersion 24
    buildToolsVersion "24.0.0"

    defaultConfig {
        applicationId "com.example.sai_praneeth7777.hasportal"
        minSdkVersion 21
        targetSdkVersion 24
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:24.0.0'

    compile 'com.google.firebase:firebase-crash:9.2.0'
    compile 'com.google.firebase:firebase-messaging:9.2.0'

    compile 'com.mcxiaoke.volley:library:1.0.18'
    compile 'com.google.code.gson:gson:2.4'

    compile 'com.android.support:cardview-v7:24.0.0'
}

apply plugin: 'com.google.gms.google-services'

This is the logcat

07-06 19:17:00.397 18894-18894/ D/FirebaseApp: com.google.firebase.auth.FirebaseAuth is not linked. Skipping initialization.
07-06 19:17:00.482 18894-18894/ W/GooglePlayServicesUtil: Google Play services out of date.  Requires 9256000 but found 9080280
07-06 19:17:00.483 18894-18894/ I/DynamiteModule: Considering local module com.google.android.gms.flags:1 and remote module com.google.android.gms.flags:0
07-06 19:17:00.487 18894-18894/ I/DynamiteModule: Selected local version of com.google.android.gms.flags
07-06 19:17:00.501 18894-18894/ W/ResourcesManager: Asset path '/system/framework/com.android.media.remotedisplay.jar' does not exist or contains no resources.
07-06 19:17:00.501 18894-18894/ W/ResourcesManager: Asset path '/system/framework/com.android.location.provider.jar' does not exist or contains no resources.
07-06 19:17:00.510 18894-18894/ W/DynamiteModule: Local module descriptor class for com.google.android.gms.crash not found.
07-06 19:17:00.517 18894-18894/ W/GooglePlayServicesUtil: Google Play services out of date.  Requires 9256000 but found 9080280
07-06 19:17:00.517 18894-18894/ I/DynamiteModule: Considering local module com.google.android.gms.crash:0 and remote module com.google.android.gms.crash:0
07-06 19:17:00.527 18894-18894/ E/FirebaseCrash: Failed to initialize crash reporting
com.google.firebase.crash.internal.zzg$zza: com.google.android.gms.internal.zzsj$zza: No acceptable module found. Local version is 0 and remote version is 0.
at com.google.firebase.crash.internal.zzg.zzbq(Unknown Source)
at com.google.firebase.crash.FirebaseCrash.<init>(Unknown Source)
at com.google.firebase.crash.FirebaseCrash.getInstance(Unknown Source)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.google.firebase.FirebaseApp.zza(Unknown Source)
at com.google.firebase.FirebaseApp.initializeApp(Unknown Source)
at com.google.firebase.FirebaseApp.initializeApp(Unknown Source)
at com.google.firebase.FirebaseApp.zzeh(Unknown Source)
at com.google.firebase.provider.FirebaseInitProvider.onCreate(Unknown Source)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1686)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1655)
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
at android.app.ActivityThread.installProvider(ActivityThread.java:4964)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:4559)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4499)
at android.app.ActivityThread.access$1500(ActivityThread.java:144)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1339)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5221)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
Caused by: com.google.android.gms.internal.zzsj$zza: No acceptable module found. Local version is 0 and remote version is 0.
at com.google.android.gms.internal.zzsj.zza(Unknown Source)
at com.google.firebase.crash.internal.zzg.zzbq(Unknown Source) 
at com.google.firebase.crash.FirebaseCrash.<init>(Unknown Source) 
at com.google.firebase.crash.FirebaseCrash.getInstance(Unknown Source) 
at java.lang.reflect.Method.invoke(Native Method) 
at java.lang.reflect.Method.invoke(Method.java:372) 
at com.google.firebase.FirebaseApp.zza(Unknown Source) 
at com.google.firebase.FirebaseApp.initializeApp(Unknown Source) 
at com.google.firebase.FirebaseApp.initializeApp(Unknown Source) 
at com.google.firebase.FirebaseApp.zzeh(Unknown Source) 
at com.google.firebase.provider.FirebaseInitProvider.onCreate(Unknown Source) 
at android.content.ContentProvider.attachInfo(ContentProvider.java:1686) 
at android.content.ContentProvider.attachInfo(ContentProvider.java:1655) 
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source) 
at android.app.ActivityThread.installProvider(ActivityThread.java:4964) 
at android.app.ActivityThread.installContentProviders(ActivityThread.java:4559) 
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4499) 
at android.app.ActivityThread.access$1500(ActivityThread.java:144) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1339) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:135) 
at android.app.ActivityThread.main(ActivityThread.java:5221) 
at java.lang.reflect.Method.invoke(Native Method) 
at java.lang.reflect.Method.invoke(Method.java:372) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694) 
07-06 19:17:00.558 18894-18894/ I/FA: App measurement is starting up, version: 9256
07-06 19:17:00.558 18894-18894/ I/FA: To enable debug logging run: adb shell setprop log.tag.FA VERBOSE
07-06 19:17:00.618 18894-18894/ I/FirebaseInitProvider: FirebaseApp initialization successful
07-06 19:17:00.682 18894-18925/ W/GooglePlayServicesUtil: Google Play services out of date.  Requires 9256000 but found 9080280
07-06 19:17:00.684 18894-18907/ I/art: Background partial concurrent mark sweep GC freed 2819(186KB) AllocSpace objects, 2(32KB) LOS objects, 53% free, 880KB/1904KB, paused 5.432ms total 47.807ms
07-06 19:17:00.700 18894-18894/ W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
07-06 19:17:00.855 18894-18927/ D/OpenGLRenderer: Render dirty regions requested: true
[ 07-06 19:17:00.881 18894:18894 D/         ]
HostConnection::get() New Host Connection established 0x7fe26aba3ec0, tid 18894
07-06 19:17:00.890 18894-18894/ D/Atlas: Validating map...
07-06 19:17:00.934 18894-18894/ W/FA: Service connection failed: ConnectionResult{statusCode=SERVICE_VERSION_UPDATE_REQUIRED, resolution=null, message=null}
07-06 19:17:00.983 18894-18907/ W/art: Suspending all threads took: 14.572ms
[ 07-06 19:17:01.050 18894:18927 D/         ]
HostConnection::get() New Host Connection established 0x7fe26d476180, tid 18927
07-06 19:17:01.064 18894-18927/ I/OpenGLRenderer: Initialized EGL, version 1.4
07-06 19:17:01.101 18894-18927/ D/OpenGLRenderer: Enabling debug mode 0
07-06 19:17:10.845 18894-18925/ I/FA: Tag Manager is not found and thus will not be used
07-06 19:17:10.847 18894-18925/ W/GooglePlayServicesUtil: Google Play services out of date.  Requires 9256000 but found 9080280
07-06 19:17:10.847 18894-18894/ W/FA: Service connection failed: ConnectionResult{statusCode=SERVICE_VERSION_UPDATE_REQUIRED, resolution=null, message=null}
07-06 19:18:19.553 18894-19743/ W/FA: Tasks have been queued for a long time
07-06 19:18:19.930 18894-18902/ W/art: Suspending all threads took: 215.213ms
07-06 19:18:20.050 18894-18907/ I/art: Background sticky concurrent mark sweep GC freed 910(82KB) AllocSpace objects, 3(48KB) LOS objects, 11% free, 1679KB/1904KB, paused 80.391ms total 305.959ms
07-06 19:18:20.059 18894-18907/ W/art: Suspending all threads took: 6.418ms

Hope this info helps solving the problem

like image 898
Devunuri Saipraneeth Avatar asked Oct 18 '22 06:10

Devunuri Saipraneeth


1 Answers

As Log show you get FirebaseApp initialization successful and this means your push-notification registered successfully.

If you send message from console and you didn't receive anything consider following things:

  • Check push notification with real devices not emulator.
  • Make sure your device access to internet.
like image 69
Amir Avatar answered Oct 31 '22 10:10

Amir