0

I am currently implementing an Android app, which uses Firebase Cloud Messaging. I've implemented everything according to the tutorial on the Firebase page.

However, whenever I try to run my app it seems like the Firebase initialization fails. Both, on an emulator and on a real device I get this debug message:

D/FirebaseApp: com.google.firebase.auth.FirebaseAuth is not linked. Skipping initialization.
W/InstanceID/Rpc: Found 10010
D/FirebaseApp: com.google.firebase.crash.FirebaseCrash is not linked. Skipping initialization.

It doesn't call the InstanceIDListener. And it strangely worked with the emulator once.

adjuremods
  • 2,938
  • 2
  • 12
  • 17
Tomsen1410
  • 41
  • 1
  • 1
  • 9
  • 1
    Can you share your entire FCM code here? – Pravin Sonawane Nov 23 '16 at 03:20
  • 2
    Have you overridden any part of the default manifest merge processing? Similar error messages in this related question: http://stackoverflow.com/q/37724761/4815718. – Bob Snyder Nov 23 '16 at 03:55
  • 2
    It seems like the problem was that the onTokenRefresh() method was not called when the app was starting and I thought that firebase doesnt work then. However, I simply called "FirebaseInstanceId.getInstance().getToken()" in the MainActivity and it worked! – Tomsen1410 Nov 23 '16 at 18:25

2 Answers2

0

You have to add the following to your android manifest:

<service android:name=".MyFirebaseInstanceIDService">
    <intent-filter>
        <action android:name="com.google.firebase.INSTANCE_ID_EVENT"/>
    </intent-filter>
</service>
Styx
  • 9,863
  • 8
  • 43
  • 53
j2emanue
  • 60,549
  • 65
  • 286
  • 456
0

I'm not sure, but I guess you missed:

FirebaseApp.initializeApp(getApplicationContext());

https://firebase.google.com/docs/reference/android/com/google/firebase/FirebaseApp