Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/react-native/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reactjs 在react native中使用fcm推送通知_Reactjs_React Native - Fatal编程技术网

Reactjs 在react native中使用fcm推送通知

Reactjs 在react native中使用fcm推送通知,reactjs,react-native,Reactjs,React Native,我正在研究react本机推送通知示例。 我生成应用程序时出错 错误是 :app:processDebugGoogleServices Parsing json file: E:\REACT-NATIVE\fcmreactnative\android\app\google-services.json :app:processDebugGoogleServices FAILED FAILURE: Build failed with an exception. * What went wrong:

我正在研究react本机推送通知示例。 我生成应用程序时出错

错误是

:app:processDebugGoogleServices
Parsing json file: E:\REACT-NATIVE\fcmreactnative\android\app\google-services.json
:app:processDebugGoogleServices FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugGoogleServices'.
> Failed to delete: E:\REACT-NATIVE\fcmreactnative\android\app\build\generated\res\google-services\debug
我使用的是android build.gradle版本

dependencies {
        classpath 'com.android.tools.build:gradle:2.2.3'
        classpath 'com.google.gms:google-services:3.2.1'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }

and android/app/build.gradle

dependencies {
     compile project(':react-native-fcm')
    compile 'com.google.firebase:firebase-core:10.0.1' 
    compile 'com.google.firebase:firebase-messaging:10.0.1'
    compile fileTree(dir: "libs", include: ["*.jar"])
    compile "com.android.support:appcompat-v7:24.2.1"
    compile "com.facebook.react:react-native:+"  // From node_modules

}
请帮助我如何解决此问题。

在控制台中,您可以:

for Android: download google-services.json file and place it in android/app directory
for iOS: download GoogleService-Info.plist file and place it in /ios/your-project-name directory (next to your Info.plist)

通过以下操作确保您有证书设置您是否运行了react-native链接?是的,我运行了它。然后确保您修改了所有必需的文件,遵循此指导原则我已加载google-services.json文件并将其添加到安卓/app/dir.Stil中。收到相同错误。成功