ionic build android error

耗尽温柔 提交于 2019-11-30 21:50:42

I guess it's because you set ANDROID_HOME to the wrong path.

ANDROID_HOME must be set to the root of the android SDK, not to tools folder:

SET ANDROID_HOME=C:\adt-bundle-windows-x86_64-20140702\sdk

But the tools folder must be in the path.

SET PATH=%PATH%;%ANDROID_HOME%\tools

(of course use windows settings to set env vars, don't do it in cmd, that was just to explain more clearly)

For Mac OSX users: you can modify your bashprofile

~ nano .bash_profile

Then add the following lines to the file and save it

export ANDROID_HOME=/usr/local/<path_to_your_androidsdk>/
export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools

Reboot your system and run a build

ionic build android

Took me some time to figure that out, hope it helps

Earlier it was

export PATH=$PATH:$ANDROID_HOME/bin

Now it's

export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools

hope it helps :)

Rajesh Rai

Make sure your android sdk path is set correctly.

Here is the way to set using command prompt then restart it:

SET ANDROID_HOME=C:\Program Files (x86)\Android\android-sdk

SET PATH=%PATH%;%ANDROID_HOME%\tools

or you can set it from system setting page.

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