Whitescreen at ionic run android

Hey everyone. I got a problem, if I run “ionic run android” to debug on device, I get the
“app.bundle.js:57703 Uncaught SyntaxError: Unexpected token =>” error, and the screen will remain blank. It works with ionic serve.
The blank starter project also works with ionic run. So the error has to be somewhere in my project. But no idea where to begin?

These are the build logs:

Running ‘run:before’ gulp task before run
[19:47:13] Starting ‘e[36mcleane[39m’…
[19:47:13] Finished ‘e[36mcleane[39m’ after e[35m39 mse[39m
[19:47:13] Starting ‘e[36mwatche[39m’…
[19:47:13] Starting ‘e[36msasse[39m’…
[19:47:13] Starting ‘e[36mhtmle[39m’…
[19:47:13] Starting ‘e[36mfontse[39m’…
[19:47:13] Starting ‘e[36mscriptse[39m’…
[19:47:13] Finished ‘e[36mscriptse[39m’ after e[35m54 mse[39m
[19:47:13] Finished ‘e[36mhtmle[39m’ after e[35m64 mse[39m
[19:47:13] Finished ‘e[36mfontse[39m’ after e[35m65 mse[39m
[19:47:14] Finished ‘e[36msasse[39m’ after e[35m836 mse[39m
13.1 MB bytes written (6.22 seconds)
[19:47:23] Finished ‘e[36mwatche[39m’ after e[35m9.91 se[39m
[19:47:23] Starting ‘e[36mrun:beforee[39m’…
[19:47:23] Finished ‘e[36mrun:beforee[39m’ after e[35m4.28 μse[39m

e[1me[32mSetup Live Reloade[39me[22m
Running live reload server: e[36mhttp://192.168.178.59:35729e[39m
Watching: e[36mwww//*, !www/lib//*e[39m
√ Running dev server: e[36mhttp://192.168.178.59:8100e[39m
Ionic server commands, enter:
e[36m restarte[39m or e[36mre[39m to restart the client app from the root
e[36m gotoe[39m or e[36mge[39m and a url to have the app navigate to the given url
e[36m consolelogse[39m or e[36mce[39m to enable/disable console log output
e[36m serverlogse[39m or e[36mse[39m to enable/disable server log output
e[36m quite[39m or e[36mqe[39m to shutdown the server and exit

ionic $ Running command: “C:\Program Files\nodejs\node.exe” C:\Users\IchRU\Documents\MyIonicProject\hooks\after_prepare\010_add_platform_class.js C:\Users\IchRU\Documents\MyIonicProject

add to body class: platform-android

ANDROID_HOME=C:\Users\IchRU\AppData\Local\Android\sdk

JAVA_HOME=C:\Program Files\java\jdk1.7.0_79

No target specified, deploying to device ‘05523c03f0df5d51’.

null

org.xwalk:xwalk_core_library:20+

:preBuild

UP-TO-DATE

:preArmv7DebugBuild
UP-TO-DATE

:checkArmv7DebugManifest

:preX86DebugBuild
UP-TO-DATE

:CordovaLib:preBuild
UP-TO-DATE

:CordovaLib:preDebugBuild

UP-TO-DATE

:CordovaLib:compileDebugNdk
UP-TO-DATE

:CordovaLib:compileLint

:CordovaLib:copyDebugLint
UP-TO-DATE

:CordovaLib:mergeDebugProguardFiles
UP-TO-DATE

:CordovaLib:packageDebugRenderscript

UP-TO-DATE

:CordovaLib:checkDebugManifest

:CordovaLib:prepareDebugDependencies

:CordovaLib:compileDebugRenderscript
UP-TO-DATE

:CordovaLib:generateDebugResValues
UP-TO-DATE

:CordovaLib:generateDebugResources
UP-TO-DATE

:CordovaLib:packageDebugResources
UP-TO-DATE

:CordovaLib:compileDebugAidl
UP-TO-DATE

:CordovaLib:generateDebugBuildConfig
UP-TO-DATE

:CordovaLib:generateDebugAssets
UP-TO-DATE

:CordovaLib:mergeDebugAssets
UP-TO-DATE

:CordovaLib:processDebugManifest
UP-TO-DATE

:CordovaLib:processDebugResources
UP-TO-DATE

:CordovaLib:generateDebugSources
UP-TO-DATE

:CordovaLib:compileDebugJavaWithJavac
UP-TO-DATE

:CordovaLib:processDebugJavaRes
UP-TO-DATE

:CordovaLib:transformResourcesWithMergeJavaResForDebug

UP-TO-DATE

:CordovaLib:transformClassesAndResourcesWithSyncLibJarsForDebug
UP-TO-DATE

:CordovaLib:mergeDebugJniLibFolders
UP-TO-DATE

:CordovaLib:transformNative_libsWithMergeJniLibsForDebug
UP-TO-DATE

:CordovaLib:transformNative_libsWithSyncJniLibsForDebug

UP-TO-DATE
:CordovaLib:bundleDebug

UP-TO-DATE

:prepareAndroidCordovaLibUnspecifiedDebugLibrary

UP-TO-DATE

:preArmv7ReleaseBuild

UP-TO-DATE
:preX86ReleaseBuild UP-TO-DATE
:CordovaLib:preReleaseBuild UP-TO-DATE
:CordovaLib:compileReleaseNdk UP-TO-DATE
:CordovaLib:copyReleaseLint UP-TO-DATE
:CordovaLib:mergeReleaseProguardFiles UP-TO-DATE
:CordovaLib:packageReleaseRenderscript

UP-TO-DATE

:CordovaLib:checkReleaseManifest

:CordovaLib:prepareReleaseDependencies

:CordovaLib:compileReleaseRenderscript
UP-TO-DATE

:CordovaLib:generateReleaseResValues
UP-TO-DATE

:CordovaLib:generateReleaseResources
UP-TO-DATE
:CordovaLib:packageReleaseResources
UP-TO-DATE

:CordovaLib:compileReleaseAidl
UP-TO-DATE

:CordovaLib:generateReleaseBuildConfig
UP-TO-DATE

:CordovaLib:generateReleaseAssets
UP-TO-DATE

:CordovaLib:mergeReleaseAssets
UP-TO-DATE

:CordovaLib:processReleaseManifest
UP-TO-DATE

:CordovaLib:processReleaseResources
UP-TO-DATE

:CordovaLib:generateReleaseSources
UP-TO-DATE

:CordovaLib:compileReleaseJavaWithJavac
UP-TO-DATE

:CordovaLib:processReleaseJavaRes
UP-TO-DATE

:CordovaLib:transformResourcesWithMergeJavaResForRelease
UP-TO-DATE

:CordovaLib:transformClassesAndResourcesWithSyncLibJarsForRelease
UP-TO-DATE

:CordovaLib:mergeReleaseJniLibFolders
UP-TO-DATE

:CordovaLib:transformNative_libsWithMergeJniLibsForRelease
UP-TO-DATE

:CordovaLib:transformNative_libsWithSyncJniLibsForRelease
UP-TO-DATE

:CordovaLib:bundleRelease

UP-TO-DATE

:prepareComAndroidSupportSupportCompat2420Library

UP-TO-DATE

:prepareComAndroidSupportSupportCoreUi2420Library
UP-TO-DATE

:prepareComAndroidSupportSupportCoreUtils2420Library

UP-TO-DATE

:prepareComAndroidSupportSupportFragment2420Library
UP-TO-DATE

:prepareComAndroidSupportSupportMediaCompat2420Library
UP-TO-DATE

:prepareComAndroidSupportSupportV42420Library

UP-TO-DATE

:prepareOrgXwalkXwalk_core_library205053312Library

UP-TO-DATE

:prepareArmv7DebugDependencies

:compileArmv7DebugAidl

UP-TO-DATE

:compileArmv7DebugRenderscript

UP-TO-DATE

:generateArmv7DebugBuildConfig

UP-TO-DATE

:generateArmv7DebugAssets

UP-TO-DATE

:mergeArmv7DebugAssets

UP-TO-DATE

:createXwalkCommandLineFileArmv7Debug

:generateArmv7DebugResValues

UP-TO-DATE

:generateArmv7DebugResources

UP-TO-DATE

:mergeArmv7DebugResources

UP-TO-DATE

:processArmv7DebugManifest

UP-TO-DATE

:processArmv7DebugResources

UP-TO-DATE

:generateArmv7DebugSources
UP-TO-DATE

:compileArmv7DebugJavaWithJavac
UP-TO-DATE

:compileArmv7DebugNdk
UP-TO-DATE

:compileArmv7DebugSources
UP-TO-DATE

:transformClassesWithDexForArmv7Debug
UP-TO-DATE

:mergeArmv7DebugJniLibFolders
UP-TO-DATE

:transformNative_libsWithMergeJniLibsForArmv7Debug
UP-TO-DATE

:processArmv7DebugJavaRes

UP-TO-DATE

:transformResourcesWithMergeJavaResForArmv7Debug
UP-TO-DATE

:validateDebugSigning

:packageArmv7Debug
UP-TO-DATE

:zipalignArmv7Debug
UP-TO-DATE

:assembleArmv7Debug
UP-TO-DATE

:cdvBuildDebug
UP-TO-DATE

BUILD SUCCESSFUL

Total time: 2.509 secs

Built the following apk(s):
C:/Users/IchRU/Documents/MyIonicProject/platforms/android/build/outputs/apk/android-debug.apk

Using apk: C:/Users/IchRU/Documents/MyIonicProject/platforms/android/build/outputs/apk/android-debug.apk

LAUNCH SUCCESS

Ionic server commands, enter:
e[36m restarte[39m or e[36mre[39m to restart the client app from the root
e[36m gotoe[39m or e[36mge[39m and a url to have the app navigate to the given url
e[36m consolelogse[39m or e[36mce[39m to enable/disable console log output
e[36m serverlogse[39m or e[36mse[39m to enable/disable server log output
e[36m quite[39m or e[36mqe[39m to shutdown the server and exit

And this is my package.json:

{
“dependencies”: {
@angular/common”: “2.0.0-rc.4”,
@angular/compiler”: “2.0.0-rc.4”,
@angular/core”: “2.0.0-rc.4”,
@angular/forms”: “0.2.0”,
@angular/http”: “2.0.0-rc.4”,
@angular/platform-browser”: “2.0.0-rc.4”,
@angular/platform-browser-dynamic”: “2.0.0-rc.4”,
“cerialize”: “^0.1.7”,
“cheerio”: “^0.20.0”,
“es6-shim”: “^0.35.0”,
“got”: “^6.3.0”,
“ineed”: “^1.0.4”,
“ionic-angular”: “2.0.0-beta.11”,
“ionic-native”: “1.3.10”,
“ionicons”: “3.0.0”,
“lodash”: “^4.14.0”,
“q”: “^1.4.1”,
“reflect-metadata”: “^0.1.3”,
“rxjs”: “5.0.0-beta.6”,
“setimmediate”: “^1.0.4”,
“tree-model”: “^1.0.4”,
“zone.js”: “^0.6.12”
},
“devDependencies”: {
“del”: “2.2.0”,
“gulp”: “3.9.1”,
“gulp-watch”: “4.3.5”,
“ionic-gulp-browserify-typescript”: “2.0.0”,
“ionic-gulp-fonts-copy”: “^1.0.0”,
“ionic-gulp-html-copy”: “^1.0.0”,
“ionic-gulp-sass-build”: “^1.0.0”,
“ionic-gulp-scripts-copy”: “^2.0.0”,
“ionic-gulp-tslint”: “^1.0.0”,
“tslint-ionic-rules”: “^0.0.3”,
“run-sequence”: “1.1.5”
},
“name”: “myionicproject”,
“description”: “MyIonicProject: An Ionic project”,
“cordovaPlugins”: [
“cordova-plugin-device”,
“cordova-plugin-console”,
“cordova-plugin-whitelist”,
“cordova-plugin-splashscreen”,
“cordova-plugin-statusbar”,
“ionic-plugin-keyboard”
],
“cordovaPlatforms”:
}

I had the same kind of problem. Those can be tricky. And you’re right, it’s most probably real problem in your code.

I used remote debugging to find it:

chrome://inspect/#devices

For more info go to [Developer Tips] (http://ionicframework.com/docs/v2/resources/developer-tips/) . Remote debugging section.

Thanks, I have used the chrome debugging. There I got the error: “app.bundle.js:57703 Uncaught SyntaxError: Unexpected token =>”. Because the app.bundle.js isn’t part of my project I’m little helpless :confused:

Sounds like one of your ES6 functions aren’t compiling down to ES5.

Somewhere in your code you’ve got something like this:

(arg1, arg2) => {
  //Do all sorts of things
}

And it’s supposed to compile to this:

function(arg1, arg2) {
   //Do all sorts of things
}

Your error seems to show that it’s not happening. I’d search the app.bundle.js file for “=>” and try to find which class isn’t compiling correctly, then go fix it in your original files.

1 Like

The class wasn’t from my project. It was something http request related. But after some trial&error I did a “ionic state reset”, reinstalled crosswalk, and it worked. What a wasted Saturday. But thanks for the help! :slight_smile:

1 Like