Build to android failing


Short description of the problem:

Trying to build an apk from my project, and the ionic prebuild portion runs just like when I run Ionic serve. However it stops after linting and does not continue the build or post build portions.

What I tried:

  1. Uninstall/Install ionic
  2. Ionic Build and then Ionic run
  3. Ionic run without a device attached, no apk produced.
  4. I followed Max’s post on updating RCo

Your system information:

Cordova CLI: 6.3.1
Ionic Framework Version: 2.0.0-rc.1
Ionic CLI Version: 2.1.4
Ionic App Lib Version: 2.1.2
Ionic App Scripts Version: 0.0.36
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Mac OS X El Capitan
Node Version: v6.7.0
Xcode version: Not installed

0 info it worked if it ends with ok
1 verbose cli [ ‘/usr/local/bin/node’, ‘/usr/local/bin/npm’, ‘run’, ‘build’ ]
2 info using npm@3.10.8
3 info using node@v6.7.0
4 verbose run-script [ ‘prebuild’, ‘build’, ‘postbuild’ ]
5 info lifecycle solaris-mobile-app@~prebuild: solaris-mobile-app@
6 silly lifecycle solaris-mobile-app@~prebuild: no script for prebuild, continuing
7 info lifecycle solaris-mobile-app@~build: solaris-mobile-app@
8 verbose lifecycle solaris-mobile-app@~build: unsafe-perm in lifecycle true
9 verbose lifecycle solaris-mobile-app@~build: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/Users/xxx/Desktop/xxx/solarisApp/node_modules/.bin:/Library/Frameworks/Python.framework/Versions/3.4/bin:/Library/Frameworks/Python.framework/Versions/3.5/bin:/Library/Frameworks/Python.framework/Versions/3.6/bin:/Users/andrewgraham-yooll/.rvm/gems/ruby-2.2.4/bin:/Users/xxx/.rvm/gems/ruby-2.2.4@global/bin:/Users/xxx/.rvm/rubies/ruby-2.2.4/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/xxx/.rvm/bin:/Users/xxx/.rvm/bin
10 verbose lifecycle solaris-mobile-app@~build: CWD: /Users/xxx/Desktop/xxx/solarisApp
11 silly lifecycle solaris-mobile-app@~build: Args: [ ‘-c’, ‘ionic-app-scripts build’ ]
12 silly lifecycle solaris-mobile-app@~build: Returned: code: 1 signal: null
13 info lifecycle solaris-mobile-app@~build: Failed to exec build script
14 verbose stack Error: solaris-mobile-app@ build: ionic-app-scripts build
14 verbose stack Exit status 1
14 verbose stack at EventEmitter. (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:255:16)
14 verbose stack at emitTwo (events.js:106:13)
14 verbose stack at EventEmitter.emit (events.js:191:7)
14 verbose stack at ChildProcess. (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:40:14)
14 verbose stack at emitTwo (events.js:106:13)
14 verbose stack at ChildProcess.emit (events.js:191:7)
14 verbose stack at maybeClose (internal/child_process.js:877:16)
14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
15 verbose pkgid solaris-mobile-app@
16 verbose cwd /Users/xxx/Desktop/xxx/solarisApp
17 error Darwin 15.6.0
18 error argv “/usr/local/bin/node” “/usr/local/bin/npm” “run” "build"
19 error node v6.7.0
20 error npm v3.10.8
21 error code ELIFECYCLE
22 error solaris-mobile-app@ build: ionic-app-scripts build
22 error Exit status 1
23 error Failed at the solaris-mobile-app@ build script ‘ionic-app-scripts build’.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the solaris-mobile-app package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error ionic-app-scripts build
23 error You can get information on how to open an issue for this project with:
23 error npm bugs solaris-mobile-app
23 error Or if that isn’t available, you can get their info via:
23 error npm owner ls solaris-mobile-app
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]

Maybe its related to this issue.

I would like to think its related, but the error being described in the console is:

[12:22:19] Error: Error encountered resolving symbol values statically. Function calls are not supported.
Consider replacing the function or lambda with a reference to an exported function, resolving
symbol AppModule in /Users/xxx/Desktop/xxx/solarisApp/.tmp/app/app.module.ts,
resolving symbol AppModule in /Users/xxx/Desktop/xxx/solarisApp/.tmp/app/app.module.ts
[12:22:19] ngc failed
[12:22:19] ionic-app-script task: “build”
[12:22:19] Error: Error

Im at a loss as to how to fix it.
Thanks for any help!

Fixed it for now by commenting out StoreDevtoolsModule.instrumentStore(configStoreDevtool()), in app.module if you are using @ngRX.

The reason is apparently the fact that you cannot do function calls with in app.module.ts