我安装react-native-push-notification后无法构建应用

时间:2019-08-12 10:55:39

标签: react-native react-native-push-notification

我从(React Native Push Notifications)安装了react-native-push-notification,但无法在android上运行该应用。我没有在IOS上进行测试

* Where:
Build file 'C:\Users\Zarzu Victor\payAssistant\node_modules\react-native-push-notification\android\build.gradle' line: 47

* What went wrong:
A problem occurred evaluating project ':react-native-push-notification'.
> Could not get unknown property 'DEFAULT_GOOGLE_PLAY_SERVICES_VERSION' for object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

1 个答案:

答案 0 :(得分:2)

从今天开始,我也面临着这个问题。我发现googlePlayServicesVersion中缺少android/build.gradle。在下面添加了一行,它解决了库的问题。

// android/build.gradle

buildscript {
    ext {
        googlePlayServicesVersion = "+" // <- add this line
    }