Build not creating main.js file


#1

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


#2

Try
cordova prepare
then
ionic build


#3

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


#4

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…


#5

I have the same problem.


#6

Any update about this? Having the same problem.


#7

Same problem in my project, also Ionic 2.0.0 RC 0


#8

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 . After fixing that, the android build worked again and main.js was created.


#9

where is the “run” log?


#10

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


#11

For me the output has an error saying:

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

Build does not fail when I do:

ionic build android

But it does when I do:

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