React Native:为GCM实施firebase会导致依赖关系问题,并且构建失败

时间:2019-03-05 21:23:48

标签: android firebase react-native firebase-realtime-database firebase-cloud-messaging

首先,我是新来的本地人。

我尝试实现推送通知,然后发现了这篇精彩的文章。 https://medium.com/@anum.amin/react-native-integrating-push-notifications-using-fcm-349fff071591

在android中:

我发现我们需要在根app.gradle中添加这些链接:

dependencies {
    classpath 'com.android.tools.build:gradle:3.1.2'
    classpath 'com.google.gms:google-services:3.2.1'
}

,然后在应用的app.gradle中添加以下实现:

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.facebook.react:react-native:+'

//Add these lines
implementation "com.google.android.gms:play-services-base:15.0.0"
implementation "com.google.firebase:firebase-core:15.0.2"
implementation "com.google.firebase:firebase-messaging:15.0.2"

}

,然后在该应用的app.gradle中应用插件:

apply plugin: 'com.google.gms.google-services'

使用该版本号设置,我的生活过得很好。但是,当我尝试构建要发布的应用程序时。抱怨

`Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.`

问题:

现在,我需要将google-services:3.2.1更新到最新的4.1.0。

我尝试根据此发行说明将各自的版本更新为最新版本: https://developers.google.com/android/guides/releases


在这里,我备有与之匹配的此版本。我无法确定选择哪个版本号来再次运行我的项目。


我想知道classpath 'com.google.gms:google-services:4.1.0'的正确实现版本。 谁能指导我该怎么做?

感谢您阅读我的问题。

0 个答案:

没有答案
相关问题