Reputation: 15
Why run the command cordova build android ,error every time
exe: cordova build android
sample CMD: FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':app:processDebugGoogleServices'.
File google-services.json is missing. The Google Services Plugin cannot function without it. Searched Location: C:\Users\Asus\Desktop\lottery-thailand\platforms\android\app\src\debug\google-services.json C:\Users\Asus\Desktop\lottery-thailand\platforms\android\app\google-services.json
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Get more help at https://help.gradle.org
BUILD FAILED in 2s 18 actionable tasks: 18 executed (node:20776) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: cmd: Command failed with exit code 1 Error output: FAILURE: Build failed with an exception.
Upvotes: 0
Views: 548
Reputation: 792
I find similar error upgrading to phonegap 7.0.0
from 6.3.0
using cordova-plugin-fcm
. I solved editing line 58 of fcm_config_files_process.js
in \plugins\cordova-plugin-fcm\scripts.js
From
fs.writeFileSync("platforms/android/google-services.json", contents);
To
fs.writeFileSync("platforms/android/app/google-services.json", contents);
Upvotes: 0
Reputation: 2153
It looks like you are trying to use a plugin which takes advantage of one or more Google services but you are missing your info file.
For these to build and work properly you need to include the Google services info file (google-services.json
for Android and/or GoogleService-Info.plist
for iOS) in the root of your project. Check to make sure the file is there, if it is not then you will need to download it from the service you are using and place it in the root of your project.
Upvotes: 1