Game'z Kittituh
Game'z Kittituh

Reputation: 15

Why cordova build android error?

Why run the command cordova build android ,error every time

exe: cordova build android

sample CMD: FAILURE: Build failed with an exception.

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

Answers (2)

Alessandro Battistini
Alessandro Battistini

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

Andrew Lively
Andrew Lively

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

Related Questions