Repository navigation
Closed
Description
Bug Report
Ionic Info
Run ionic info from a terminal/cmd prompt and paste the output below.
Ionic:
ionic (Ionic CLI) : 4.0.3 (/usr/local/lib/node_modules/ionic)
Ionic Framework : @ionic/angular 4.0.0-beta.1
@angular-devkit/core : 0.7.2
@angular-devkit/schematics : 0.7.2
@angular/cli : 6.1.2
@ionic/ng-toolkit : 1.0.2
@ionic/schematics-angular : 1.0.3
Cordova:
cordova (Cordova CLI) : 8.0.0
Cordova Platforms : android 7.1.1, ios 4.5.5
System:
Android SDK Tools : 26.1.1
ios-deploy : 2.0.0
NodeJS : v10.8.0 (/usr/local/Cellar/node/10.8.0/bin/node)
npm : 6.2.0
OS : macOS High Sierra
Xcode : Xcode 9.4.1 Build version 9F2000
Environment:
ANDROID_HOME : /Users/heb/Library/Android/sdk
Describe the Bug
Even the simplest myApp Ionic4/Angular6 demo does not proceed past the loading index.html when running on Android (device or emulator). Browser and iOS are fine.
Steps to Reproduce
Steps to reproduce the behavior:
0. Make sure an Android SDK is installed and in the PATH and env variables
- Create a test app, e.g. via
ionic start myApp tabs --type=angular - Start logcat e.g. from command line via
adb logcat - Add the Android platform via
ionic cordova platform add android - Run
ionic cordova emulate android - App starts but shows a blank white page (which is the index.html)
Related Log
During app start up in the emulator the logcat logs the following error which I think is the root cause for the app not continuing loading.
D/SystemWebChromeClient( 6353): http://localhost:8080/vendor.js: Line 71984 : Uncaught SyntaxError: Use of const in strict mode.
I/chromium( 6353): [INFO:CONSOLE(71984)] "Uncaught SyntaxError: Use of const in strict mode.", source: http://localhost:8080/vendor.js (71984)
D/CordovaWebViewImpl( 6353): onPageFinished(http://localhost:8080/)
Expected Behavior
App should finish starting up.
Additional Context
This error only happens on Android devices and the emulator, but not when starting the app on Android via the Ionic DevApp tool.
Metadata
Metadata
Assignees
Labels
No labels
Type
Fields
No fields configured for issues without a type.
Activity
hebra commentedon Aug 6, 2018
As an additional information: the first line where the const keyword occurs in the vendor.js from the android apk file seems to be some Ionic-specific initialization:
hebra commentedon Aug 9, 2018
Updated to the latest Ionic 4 Beta 2 release this morning - problem still persists.
Created a new test project via
ionic start i4a6-app tabs --type=angularand run it on the emulator (and a test Android device).One other thing I found is: when I rollback my project to Ionic 3 and Angular 5 the whole thing works w/o any issue even though the vendor.js also has plenty of 'use strict' and 'const' uses.
hebra commentedon Aug 9, 2018
For reference here are the project configuration files for the test project I created (the Android platform and node_modules folders have been removed to reduce file size).
i4a6-app.zip
timhill1989 commentedon Aug 9, 2018
Same issue for me. I know this behaviour existed in the past as well with older Android Versions. We used to use Crosswalk in those projects, targeting Android 4.xx.
Right now, Android > 5.1 works for me. But lower doesnt
hebra commentedon Aug 9, 2018
@timhill1989 can you share your project files (config.xml, package.json etc.) of the project which works for you? Also which Android SDK version are you using?
timhill1989 commentedon Aug 9, 2018
Let me know if you need other information.
Started from empty template, not much functionality added yet.
API 22 Emulator/Device throws error
Api 27 Emulator/Device works
config.xml
package.json
hebra commentedon Aug 9, 2018
Thanks @timhill1989 - I can confirm that it is actually working with Android 8.x but not any older version. Considering the current market share for Oreo of just 10% I see this as a blocker for Ionic 4 right now. At least 6 (23%) & 7 (34%) have to be supported as well, better include 5 (15%) as well.
hebra commentedon Aug 10, 2018
After some testing with different SDK versions and emulators I can confirm that the minimum version as of now has to be SDK 25 (Android 7.1.1 Nougat). Anything older, even Android 7.0 (SDK 24) will not work with the current Ionic 4 beta release.
unit-cesar commentedon Aug 14, 2018
Just contributing. My tests with API 23, 24, 25, 26 and 27 using AVD (Android Studio) and Genymotion:
Nexus_5X_API_23_-_Marshmallow_6.0:
Doesn't work on AVD (Android Studio) and Genymotion. White screen!
Nexus_5X_API_24_-_Nougat_7.0:
Doesn't work on AVD (Android Studio) and Genymotion. White screen!
Nexus_5X_API_25_Nougat_7.1.1: Works in parts!
On Genymotion: Doesn't work. White screen!
On AVD (Android Studio):
The new tag
<ion-img>does not show the image, I had to go back to the old tag:Nexus_5X_API_26_-_Oreo_8.0: It works!
Works on AVD (Android Studio) and Genymotion
Nexus_5X_API_27_-8.1-_Oreo:
On Genymotion: Doesn't exist.
On AVD (Android Studio): It works!
It's a huge range of devices out of target.
The difficulty is of the devices? Or Ionic engineering?
Can we expect improvements in version 4 to achieve at least API 23?
unit-cesar commentedon Aug 14, 2018
About my system:

snowyu commentedon Aug 28, 2018
I found the reason: the compiled code of
@ionic/angularis not thees5code.It use the new
async/awaitkeyword inES2017.snowyu commentedon Aug 28, 2018
The target is set to
es2017notes5. Why?https://github.com/ionic-team/ionic/blob/25479e4ad8461a8a788a4bdcff3ed32955e6cadc/core/tsconfig.json#L25
unit-cesar commentedon Aug 28, 2018
The switch to es2017 happened in this commit:
06ad60e
unit-cesar commentedon Aug 29, 2018
Perfect @snowyu
In Genymotion I tested with API 23 (Marshmallow 6.0), I enabled the PlayStore and then I installed the Webview Android System, it works !!!
We should try to guide the user to install or update the Webview Android System. Add a function in index.html, if the application doesn't load?
6 remaining items
lemosen commentedon Sep 25, 2018
I have a same problem
mictay commentedon Sep 29, 2018
Same issue White Screen
hiepxanh commentedon Nov 6, 2018
tracking issue here, causing of transplie module PROPER PACKAGE FOR ANGULAR #15191
raphjutras commentedon Nov 13, 2018
Bump.. huge blocker for me. I would like to support Android 5.0 and UP.. This is just 'too' important to ignore... We are currently developing on Ionic 4 Beta 15 and wanted to release when Ionic 4 is officially out, Will it support Android 5?
hebra commentedon Nov 14, 2018
@raphjutras the only way I see right now for 5.0 is to use Ionic 3 and to not upgrade to 4.
raphjutras commentedon Nov 14, 2018
@hebra You think that when they will release "official" version of Ionic 4, they will not support Android 5!?
Or you mean 'right now' ..?
hiepxanh commentedon Nov 14, 2018
@raphjutras they will support but not now, they are working on it and will release with ionic 4 final. tracking at here IONIC 4 WON'T WORK IN ANDROID 5. It been move from

in processtoon deskraphjutras commentedon Nov 14, 2018
Ohhh, thank you :)
nextbyn commentedon Nov 23, 2018
Same issue with
`Ionic:
ionic (Ionic CLI) : 4.0.0 (C:\Users\exe\AppData\Roaming\nvm\v8.11.2\node_modules\ionic)
Ionic Framework : ionic-angular 3.9.2
@ionic/app-scripts : 3.2.0
Cordova:
cordova (Cordova CLI) : 8.1.2 ([email protected])
Cordova Platforms : android 7.1.2
System:
NodeJS : v8.11.3 (C:\Program Files\nodejs\node.exe)
npm : 5.6.0
OS : Windows 10`
Result:
White screen!
with ionic 3.9.2 when do 'ionic cordova run android' get white screen error and on console show Uncaught SyntaxError: Unexpected token function
any help is appreciate
the error in fact is this async await word!
async customfunction() { <---code----> }ionitron-bot commentedon Nov 29, 2018
This issue has been automatically identified as an Ionic 3 issue. We recently moved Ionic 3 to its own repository. I am moving this issue to the repository for Ionic 3. Please track this issue over there.
If I've made a mistake, and if this issue is still relevant to Ionic 4, please let the Ionic Framework team know!
Thank you for using Ionic!
ionitron-bot commentedon Nov 29, 2018
Issue moved to: ionic-team/ionic-v3#658