# ionic build android failed

**URL:** <https://forum.ionicframework.com/t/ionic-build-android-failed/89093>\
**Category:** ionic-v3\
**Created:** [May 5, 2017, 2:22pm UTC](https://forum.ionicframework.com/t/ionic-build-android-failed/89093 "2017-05-05T14:22:04Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![namhd](https://avatars.discourse-cdn.com/v4/letter/n/bbe5ce/32.png) [@namhd](https://forum.ionicframework.com/u/namhd)\
**Post date:** [May 5, 2017, 2:22pm UTC](https://forum.ionicframework.com/t/ionic-build-android-failed/89093/1 "2017-05-05T14:22:05Z")

</div>

Error:

```auto
[16:43:44] ionic-app-scripts 1.3.7
[16:43:44] build dev started ...
[16:43:44] clean started ...
[16:43:44] clean finished in 8 ms
[16:43:44] copy started ...
[16:43:44] transpile started ...
[16:43:49] transpile finished in 4.51 s
[16:43:49] preprocess started ...
[16:43:49] deeplinks started ...
[16:43:49] deeplinks finished in 17 ms
[16:43:49] preprocess finished in 18 ms
[16:43:49] webpack started ...
[16:43:49] copy finished in 5.01 s
[16:44:03] webpack finished in 14.87 s
[16:44:03] sass started ...
[16:44:05] sass finished in 1.80 s
[16:44:05] postprocess started ...
[16:44:05] postprocess finished in 25 ms
[16:44:05] lint started ...
[16:44:05] build dev finished in 21.30 s
[16:44:09] lint finished in 3.33 s
ANDROID_HOME=C:\Users\stpng\AppData\Local\Android\sdk

JAVA_HOME=C:\Program Files\Java\jdk1.8.0_121

FAILURE: Build failed with an exception.

What went wrong:
java.io.IOException: Invalid argument

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

Error: cmd: Command failed with exit code 1

```

Ionic info

```auto
ordova CLI: 7.0.0
Ionic CLI Version: 2.2.3
Ionic App Lib Version: 2.2.1
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 10
Node Version: v6.10.2
Xcode version: Not installed

Android 7.1.1
android sdk platform 25

```

Ionic flatform list:

```auto
Installed platforms:
  android 6.3.0-dev
Available platforms:
  blackberry10 ~3.8.0 (deprecated)
  browser ~4.1.0
  webos ~3.7.0
  windows ~5.0.0

```

---

<div class="post-metadata">

**Author:** ![Sujan12](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sujan12/32/108395_2.png) [@Sujan12](https://forum.ionicframework.com/u/Sujan12)\
**Post date:** [May 5, 2017, 2:22pm UTC](https://forum.ionicframework.com/t/ionic-build-android-failed/89093/2 "2017-05-05T14:22:43Z")

</div>

Please edit your post and use the `</>` button above the post input field to format your code or error message or wrap it in ````` (“code fences”) manually. This will make sure your text is readable and if it recognizes the programming language it also automatically adds code syntax highlighting. Thanks.

Also post the output of `ionic platform list` please.

---

<div class="post-metadata">

**Author:** ![namhd](https://avatars.discourse-cdn.com/v4/letter/n/bbe5ce/32.png) [@namhd](https://forum.ionicframework.com/u/namhd)\
**Post date:** [May 5, 2017, 2:36pm UTC](https://forum.ionicframework.com/t/ionic-build-android-failed/89093/3 "2017-05-05T14:36:05Z")

</div>

Thanks, i create app with ionic can run in web but can’t build android

---

<div class="post-metadata">

**Author:** ![Sujan12](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sujan12/32/108395_2.png) [@Sujan12](https://forum.ionicframework.com/u/Sujan12)\
**Post date:** [May 5, 2017, 2:43pm UTC](https://forum.ionicframework.com/t/ionic-build-android-failed/89093/4 "2017-05-05T14:43:31Z")

</div>

> [@namhd](#):
>
> android 6.3.0-dev

This seems to be a beta, dev version. You should probably remove your Android platform and add the default one to see if this fixes your problem.

---

<div class="post-metadata">

**Author:** ![namhd](https://avatars.discourse-cdn.com/v4/letter/n/bbe5ce/32.png) [@namhd](https://forum.ionicframework.com/u/namhd)\
**Post date:** [May 5, 2017, 2:59pm UTC](https://forum.ionicframework.com/t/ionic-build-android-failed/89093/5 "2017-05-05T14:59:45Z")

</div>

Thanks,I run agian with android 6.2.2 but can’t build

---

<div class="post-metadata">

**Author:** ![Sujan12](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sujan12/32/108395_2.png) [@Sujan12](https://forum.ionicframework.com/u/Sujan12)\
**Post date:** [May 5, 2017, 3:04pm UTC](https://forum.ionicframework.com/t/ionic-build-android-failed/89093/6 "2017-05-05T15:04:32Z")

</div>

What is the exact command you are calling to build?  
Does your Android SDK and JDK really live where it says in the error message?  
How did you instal the Android SDK?[quote=“namhd, post:1, topic:89093”]  
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.  
[/quote]

Did any of this work?

---

<div class="post-metadata">

**Author:** ![namhd](https://avatars.discourse-cdn.com/v4/letter/n/bbe5ce/32.png) [@namhd](https://forum.ionicframework.com/u/namhd)\
**Post date:** [May 5, 2017, 3:16pm UTC](https://forum.ionicframework.com/t/ionic-build-android-failed/89093/7 "2017-05-05T15:16:10Z")

</div>

i use command `ionic build android` calling to build, use android studio install android sdk  
i added JAVA\_HOME, ANDROID\_HOME to environment

---

<div class="post-metadata">

**Author:** ![Sujan12](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sujan12/32/108395_2.png) [@Sujan12](https://forum.ionicframework.com/u/Sujan12)\
**Post date:** [May 5, 2017, 3:32pm UTC](https://forum.ionicframework.com/t/ionic-build-android-failed/89093/8 "2017-05-05T15:32:20Z")

</div>

> [@namhd](#):
>
> i added JAVA\_HOME, ANDROID\_HOME to environment

Yes, but are they **correct**?

One thing sometimes causes problem are long paths and permissions. Maybe reinstall your SDK in another location, like `C:\Android`.

---

<div class="post-metadata">

**Author:** ![namhd](https://avatars.discourse-cdn.com/v4/letter/n/bbe5ce/32.png) [@namhd](https://forum.ionicframework.com/u/namhd)\
**Post date:** [May 5, 2017, 4:32pm UTC](https://forum.ionicframework.com/t/ionic-build-android-failed/89093/9 "2017-05-05T16:32:45Z")

</div>

```auto
ANDROID_HOME=C:\Users\stpng\AppData\Local\Android\sdk

JAVA_HOME=C:\Program Files\Java\jdk1.8.0_121

```

i test app in android studio
