Ionic Android Build Error: cmd: Command failed with exit code 1 [solution]

荒凉一梦 提交于 2021-01-28 17:54:53

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!