问题
I'm new to coding and also Ionic, but here is a solution to an issue that I faced, with an explanation for my situation.
I tried to ionic build android
but it gave out an error message that ended with Command failed with exit code 1
The fix would be to ionic platform remove android
and then add it back again with ionic platform add android
.
Where it went wrong, I think, is that I updated my android's xml manifest, to update the name for the app. So if you did the same, this will definitely solve it for you.
Maybe someone out there can explain further, and point out a workaround that doesn't require removing the platform.
回答1:
Try running the android tools and installing the items below:
Open the SDK manager. You will require: 1. "SDK Platform" for android-23 2. "Android SDK Platform-tools (latest) 3. "Android SDK Build-tools" (latest)
回答2:
I was having the same issue and fixed it by just removing platform and again adding the same one.
Remove Platform
$ cordova platform remove android
Add Platform
$ cordova platform add android
It works for me!
回答3:
just go to '/home/user/.gradle/wrapper/dists/**'**
delete everything inside of this
then build again.
来源:https://stackoverflow.com/questions/38102445/ionic-android-build-error-cmd-command-failed-with-exit-code-1-solution