2017-04-10 108 views
-3

我有一个科尔多瓦Android项目,我已经添加了Google Firebase Cloud Messaging Cordova Push Plugin无法解析com.google.firebase.iid.zzb类型。它是间接需要的.class文件中引用

我得到的MyFirebaseMessagingService.java文件下面的错误。

The hierarchy of the type MyFirebaseMessagingService is inconsistent 

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

我的类路径文件。

<?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> 

我已尝试删除和添加不同的jar文件,但没有运气的各种组合。

有没有其他人在添加此插件之前遇到此错误?

感谢您的任何帮助。如果需要,我可以发布更多代码或截图。

+0

提示:到底 “类路径” 的信息是您正在使用的JAR文件的列表。换句话说:**文本**。截图是最后的手段;只有在没有其他方式时才使用它。 – GhostCat

回答

0

猜测:你失去了一些东西,像Jar为firebase- 核心

看到自己documentation进一步的信息!

问题是:有时你的JAR文件依赖于其他JAR文件;而这个错误信息只是告诉你,你遇到了这样的问题。然后,你必须开始搜索在哪里获得“失踪”部分。

所有这些应该很好地插入到Android studio/gradle构建环境中;详情请参阅here

+0

在这里相当愚蠢,但我无法在任何地方找到核心jar文件。你有链接? – Pooshonk

+0

我给你的链接告诉你如何设置你的构建脚本来自动拖动它。 – GhostCat

0

您错过了项目中使用过的jar文件的某些功能或方法。 创建一个单独的库项目中添加哪些下面的链接中提到的所有所需的jar: -

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

现在加上这个库项目到你退出项目,将解决你的问题。下面

注意是,你必须在你的库项目包括jar文件: -

1)dandar3 /谷歌Android-火力常见 2)dandar3 /谷歌Android-火力-IID 3 )dandar3 /谷歌Android播放服务地下室 4)https://github.com/dandar3/android-google-play-services-tasks/blob/11.2.0/libs/google-play-services-tasks.jar 5)谷歌火力-messaging.jar

相关问题