简体   繁体   中英

Cordova/PhoneGap - Build failed Error code 1 for command

I am doing a cordova app. The iOS is running well. But today, I tried it for Android. When I run the command : cordova build android I have the build failed :

* Where:
Build file '/Users/guillaume/Desktop/fcm/platforms/android/build.gradle' line: 22

* What went wrong:
A problem occurred evaluating root project 'android'.
> Failed to apply plugin [id 'android']
   > Gradle version 2.10 is required. Current version is 2.2.1. If using the gradle wrapper, try editing the distributionUrl in /Users/guillaume/Desktop/fcm/gradle/wrapper/gradle-wrapper.properties to gradle-2.10-all.zip

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED


Error: Error code 1 for command: /Users/guillaume/Desktop/fcm/platforms/android/gradlew with args: cdvBuildDebug,-b,/Users/guillaume/Desktop/fcm/platforms/android/build.gradle,-Dorg.gradle.daemon=true,-Pandroid.useDeprecatedNdk=true

I tried to do what it says : change fcm/gradle/wrapper/gradle-wrapper.properties to gradle-2.10-all.zip The fact is, in my cordova folder (named fcm), I don't have gradle folder.

UPDATE: I have to tell you that I changed the package name in config.xml. Before that, the build was ok in Android, but I couldn't run the APK because it was signed with a package already used.

What am I supposed to do ?

Try to remove platform android and re add it before build. I may work for some of you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM