react-native - React Native 命令行 'processDebugGoogleServices' 错误

标签 react-native react-native-android

我正在尝试使用以下 build.gradle 文件构建一个应用程序,但总是有一个错误无法创建文件夹。我检查了很多答案,但没有人帮助我。

* What went wrong:
Execution failed for task ':app:processDebugGoogleServices'.
> Failed to create folder: D:\App\android\app\build\generated\res\google-services\debug

我的 app/build.gradle文件
dependencies {
    compile project(':react-native-android-permissions')
    compile project(':react-native-push-notification')
    compile project(':react-native-fbsdk')
    compile project(':react-native-google-signin')
    compile project(':react-native-image-resizer')
    compile project(':react-native-image-picker')
    compile project(':react-native-fs')
    compile project(':react-native-vector-icons')
    compile project(':react-native-maps')
    compile fileTree(dir: "libs", include: ["*.jar"])
    compile "com.android.support:appcompat-v7:25.0.0"
    compile "com.facebook.react:react-native:+"  // From node_modules
    compile project(':RNPermissionsModule')
    compile(project(":react-native-google-signin")) {
        exclude group: "com.google.android.gms"
    }
    compile(project(':react-native-fbsdk')){
        exclude(group: 'com.facebook.android', module: 'facebook-android-sdk')
    }
    compile "com.facebook.android:facebook-android-sdk:4.22.1"
    compile "com.google.android.gms:play-services-maps:11.8.0"
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile "com.android.support:appcompat-v7:25.0.1"
    compile project(':react-native-push-notification')
    compile ('com.google.android.gms:play-services-gcm:11.8.0') {
        force = true;
    }
}
apply plugin: 'com.google.gms.google-services'

最佳答案

您是否也在类路径中使用过谷歌服务插件?
如果没有,请写在位于 app 文件夹外的 build.gradle

classpath 'com.google.gms:google-services:3.0.0'

我想这会帮助你..!!

关于react-native - React Native 命令行 'processDebugGoogleServices' 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49508836/

相关文章:

ios - 无法解决错误 : Unable to resolve module `./node_modules/react-native/packager/src/components` React Native

android - Gradle 构建守护进程在 CircleCI 中意外消失

css - React Navigation - 创建选项卡导航器元素不起作用?

javascript - onClick() 不会触发 React-Native App 中的函数

react-native - ScrollView [React Native] 下的可点击背景

React-native 依赖错误(com.atlassian.mobile.video okhttp-ws-compat)

react-native - 在goBack()上刷新上一个屏幕

react-native - axios 和 android 模拟器的网络错误

javascript - React Native 扩展多个组件 vs createClass

javascript - 通过 uri 的图像未显示