# Build not creating main.js file

**URL:** <https://forum.ionicframework.com/t/build-not-creating-main-js-file/65080>\
**Category:** ionic-v3\
**Created:** [September 29, 2016, 9:31pm UTC](https://forum.ionicframework.com/t/build-not-creating-main-js-file/65080 "2016-09-29T21:31:51Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![wwwguy](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/wwwguy/32/106070_2.png) [@wwwguy](https://forum.ionicframework.com/u/wwwguy)\
**Post date:** [September 29, 2016, 9:31pm UTC](https://forum.ionicframework.com/t/build-not-creating-main-js-file/65080/1 "2016-09-29T21:31:51Z")

</div>

When I try to `ionic build android` something is causing the main.js file not to be generated so the following error is kicking out when attempting to run it on a local device:

E/AndroidProtocolHandler: Unable to open asset URL: file:///android\_asset/www/build/main.js

Your system information:  
Cordova CLI: 6.3.1  
Ionic Framework Version: 2.0.0-rc.0  
Ionic CLI Version: 2.1.0  
Ionic App Lib Version: 2.1.0-beta.1  
OS:  
Node Version: v6.7.0

---

<div class="post-metadata">

**Author:** ![racheal](https://avatars.discourse-cdn.com/v4/letter/r/ee7513/32.png) [@racheal](https://forum.ionicframework.com/u/racheal)\
**Post date:** [September 30, 2016, 12:43am UTC](https://forum.ionicframework.com/t/build-not-creating-main-js-file/65080/2 "2016-09-30T00:43:55Z")

</div>

Try  
cordova prepare  
then  
ionic build

---

<div class="post-metadata">

**Author:** ![marcsyp](https://avatars.discourse-cdn.com/v4/letter/m/977dab/32.png) [@marcsyp](https://forum.ionicframework.com/u/marcsyp)\
**Post date:** [September 30, 2016, 9:33pm UTC](https://forum.ionicframework.com/t/build-not-creating-main-js-file/65080/3 "2016-09-30T21:33:45Z")

</div>

I am also having this problem – Ionic Serve works but running on device does not. Fails with Failed to Load Resource main.js.

I tried using both ionic prepare and cordova prepare before hand, no change.

My system information:

Cordova CLI: 6.3.1  
Ionic Framework Version: 2.0.0-rc.0  
Ionic CLI Version: 2.1.0  
Ionic App Lib Version: 2.1.0-beta.1  
OS: Windows 7 SP1  
Node Version: v6.7.0

---

<div class="post-metadata">

**Author:** ![marcsyp](https://avatars.discourse-cdn.com/v4/letter/m/977dab/32.png) [@marcsyp](https://forum.ionicframework.com/u/marcsyp)\
**Post date:** [September 30, 2016, 9:52pm UTC](https://forum.ionicframework.com/t/build-not-creating-main-js-file/65080/4 "2016-09-30T21:52:38Z")

</div>

Just solved this – was due to TS errors and a leftover .tmp directory that was failing to clean out. Look in the ‘run’ log in the console to track down any compiler errors…

---

<div class="post-metadata">

**Author:** ![abrahamstalin](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/abrahamstalin/32/103626_2.png) [@abrahamstalin](https://forum.ionicframework.com/u/abrahamstalin)\
**Post date:** [October 4, 2016, 2:31am UTC](https://forum.ionicframework.com/t/build-not-creating-main-js-file/65080/5 "2016-10-04T02:31:32Z")

</div>

I have the same problem.

---

<div class="post-metadata">

**Author:** ![Ellezo](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/ellezo/32/104261_2.png) [@Ellezo](https://forum.ionicframework.com/u/Ellezo)\
**Post date:** [October 6, 2016, 6:22am UTC](https://forum.ionicframework.com/t/build-not-creating-main-js-file/65080/6 "2016-10-06T06:22:25Z")

</div>

Any update about this? Having the same problem.

---

<div class="post-metadata">

**Author:** ![AndiXng](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/andixng/32/101687_2.png) [@AndiXng](https://forum.ionicframework.com/u/AndiXng)\
**Post date:** [October 6, 2016, 10:24pm UTC](https://forum.ionicframework.com/t/build-not-creating-main-js-file/65080/7 "2016-10-06T22:24:48Z")

</div>

Same problem in my project, also Ionic 2.0.0 RC 0

---

<div class="post-metadata">

**Author:** ![AndiXng](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/andixng/32/101687_2.png) [@AndiXng](https://forum.ionicframework.com/u/AndiXng)\
**Post date:** [October 7, 2016, 5:40am UTC](https://forum.ionicframework.com/t/build-not-creating-main-js-file/65080/8 "2016-10-07T05:40:11Z")

</div>

Solved in my case. I really had a build error in the console log. `ionic serve` was working, but not the android build. There seem to be stricter rules! In my case a pipe call was not working, see [[SOLVED] Pipes in RC0](https://forum.ionicframework.com/t/solved-pipes-in-rc0/65226) . After fixing that, the android build worked again and main.js was created.

---

<div class="post-metadata">

**Author:** ![mg1075\_ionic](https://avatars.discourse-cdn.com/v4/letter/m/71e660/32.png) [@mg1075\_ionic](https://forum.ionicframework.com/u/mg1075_ionic)\
**Post date:** [December 27, 2016, 11:08pm UTC](https://forum.ionicframework.com/t/build-not-creating-main-js-file/65080/9 "2016-12-27T23:08:59Z")

</div>

where is the “run” log?

---

<div class="post-metadata">

**Author:** ![marcsyp](https://avatars.discourse-cdn.com/v4/letter/m/977dab/32.png) [@marcsyp](https://forum.ionicframework.com/u/marcsyp)\
**Post date:** [December 30, 2016, 2:36am UTC](https://forum.ionicframework.com/t/build-not-creating-main-js-file/65080/10 "2016-12-30T02:36:09Z")

</div>

Just the output of the console after you run the 'ionic run android’  
command…

---

<div class="post-metadata">

**Author:** ![zxcasd](https://avatars.discourse-cdn.com/v4/letter/z/8c91f0/32.png) [@zxcasd](https://forum.ionicframework.com/u/zxcasd)\
**Post date:** [February 1, 2017, 9:00pm UTC](https://forum.ionicframework.com/t/build-not-creating-main-js-file/65080/11 "2017-02-01T21:00:52Z")

</div>

For me the output has an error saying:

```auto
build dev failed: Cannot set property 'fileSystem' of null

```

Build does not fail when I do:

```auto
ionic build android

```

But it does when I do:

```auto
ionic run android -l -p 9999 -r 9998 -c

```
