-2

I have a Cordova Android project, and I have added the Google Firebase Cloud Messaging Cordova Push Plugin

I am getting the following error on the MyFirebaseMessagingService.java file.

The hierarchy of the type MyFirebaseMessagingService is inconsistent

and

The type com.google.firebase.iid.zzb cannot be resolved. It is indirectly referenced from required .class files

My classpath file.

<?xml version="1.0" encoding="UTF-8"?>
    <classpath>
    <classpathentry kind="src" path="src"/>
    <classpathentry kind="src" path="gen"/>
    <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
    <classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
    <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
    <classpathentry exported="true" kind="lib" path="Downloads/google-play-services.jar/google-play-services.jar"/>
    <classpathentry exported="true" kind="lib" path="Downloads/google-firebase-iid.jar"/>
    <classpathentry exported="true" kind="lib" path="Downloads/firebase-messaging-9.2.0.jar"/>
    <classpathentry exported="true" kind="lib" path="Downloads/android-support-v4.jar (2)/android-support-v4.jar"/>
    <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
    <classpathentry kind="output" path="bin/classes"/>
</classpath>

I have tried various combinations of removing and adding different jar files but no luck.

Has anyone else come across this error before when adding this plugin?

Thanks for any help. I can post more code or screenshots if needed.

AL.
  • 36,815
  • 10
  • 142
  • 281
Pooshonk
  • 1,284
  • 2
  • 22
  • 49
  • Hint: "class path" information in the end is a list of JAR files you are using. In other words: **text**. Screenshots are the last resort; only use that when there is no other way. – GhostCat Apr 10 '17 at 10:29

2 Answers2

0

Guessing: you are missing something like the JAR for firebase-core

See their documentation for further information!

The point is: sometimes your JAR files depend on other JAR files; and that error message simply tells you that you ran into such a problem. Then you have to start searching where to acquire the "missing" part.

All of this should plug nicely into the Android studio / gradle build environment; see here for details.

Community
  • 1
  • 1
GhostCat
  • 137,827
  • 25
  • 176
  • 248
0

You have missed some function or method of used jar file in your project . Create a separate library project in which add all required jar which mentioned in below link :-

https://github.com/dandar3/android-google-firebase-messaging

Now add this library project into you exiting project , will solve your problem.

Note below are the jar file which you have to include in your library project :-

1)dandar3/android-google-firebase-common 2)dandar3/android-google-firebase-iid 3)dandar3/android-google-play-services-basement 4) https://github.com/dandar3/android-google-play-services-tasks/blob/11.2.0/libs/google-play-services-tasks.jar 5) google-firebase-messaging.jar