问题
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.
回答1:
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>
回答2:
I'm not sure, but I guess you missed:
FirebaseApp.initializeApp(getApplicationContext());
https://firebase.google.com/docs/reference/android/com/google/firebase/FirebaseApp
来源:https://stackoverflow.com/questions/40754358/firebase-android-skipping-initialization