添加依赖项时出现编译错误:com.google.firebase:firebase-core

时间:2019-04-02 11:06:48

标签: android firebase cordova gradle push-notification

我正在尝试将Cordova插件Phonegap Plugin Push plugin修改为包含func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { let cell : LandingCell = collectionView.dequeueReusableCell(withReuseIdentifier: "yourCellName", for: indexPath) if indexPath.item == 1 { //zoom code u can do it by increase the cell height and increase the font size } return cell } 。为此,我在plugin.xml中添加了FirebaseAnalytics作为依赖项:

firebase-core

如果我将此插件添加到新项目(未安装其他插件)并尝试编译,则会收到错误消息:

<framework src="com.google.firebase:firebase-core:16.0.8"/>

我不知道这种冲突是从哪里来的。我试图在项目中搜索Failed to notify dependency resolution listener. > The library com.google.android.gms:play-services-basement is being requested by various other libraries at [[15.0.1,15.0.1]], but resolves to 16.2.0. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies. > The library com.google.firebase:firebase-iid is being requested by various other libraries at [[16.0.0,16.0.0]], but resolves to 17.0.3. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies. play-services-basement,但是没有匹配项。我也没有在firebase-iid依赖项列表中看到它们。

我该如何解决?找出冲突源于何处的最佳方法是什么?

2 个答案:

答案 0 :(得分:0)

我能够通过将“ com.google.firebase:firebase-messaging:”的版本更新为17.5.0来解决此问题,我使用的是17.0.0

答案 1 :(得分:0)

转到platform / android / project.properties,然后指定要使用的版本。 而不是使用“ +” com.google.firebase:firebase-messaging:17.3.+ 使用指定的版本 com.google.firebase:firebase-messaging:17.6.0