Ionic 2+, white screen in android. It looks like webview does not support ES2015


#1

Hi all, my app has a terrible problem with android devices(IOS and Browser are OK). It is always white screen after started. I debugged it by chrome devtool. There are different errors in different devices.

  • Google Nexus 7 API 23 : Uncaught SyntaxError: missing ) after argument list : main.js:20861
    The code below
var promise = new Promise((re, reject) => {                   //**row number: 20861**
	let i = 0;
	this.storage.keys().then((keys) => __awaiter(this, void 0, void 0, function* () {
		for (var key of keys) {
			if (key.startsWith("[pro]")) {
				i++;
				yield this.storage.remove(key);
			}
		}
		re(i);
		yield this.storage.remove(__WEBPACK_IMPORTED_MODULE_1__providers_config__["a" /* MyConfig */].storageKeys.proCacheInfo);
		console.log("clear pro count:" + i);
	}), err => {
		console.log("clear reject:" + err);
		reject(err);
	}).catch(err => console.log("clear catch exception:" + err));
});  
  • HTC One API 19: Uncaught SyntaxError: main.js:15480
    The code below

"use strict";
class MyConfig {                 //**row number: 15480**
}
/* harmony export (immutable) */ __webpack_exports__["a"] = MyConfig;

MyConfig.urls = {
    org: "http://www.myweburl.com/api/",
};
MyConfig.storageKeys = {
    userInfo: "UserInfo",
    orgInfo: "orgInfo",
    proCacheInfo: "proCacheInfo",
    sysconfig: "sysconfig",
};

####My local environment info:

global packages:

@ionic/cli-utils : 1.1.2
Cordova CLI      : 7.0.1
Ionic CLI        : 3.1.2

local packages:

@ionic/app-scripts              : 1.1.4
@ionic/cli-plugin-cordova       : 1.1.2
@ionic/cli-plugin-ionic-angular : 1.1.2
Ionic Framework                 : ionic-angular 2.3.0

System:

Node       : v6.10.3
OS         : Windows 10
Xcode      : not installed
ios-deploy : not installed
ios-sim    : not installed

tsconfig.json is below:

{
  "compilerOptions": {
    "allowSyntheticDefaultImports": true,
    "declaration": false,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "lib": [
      "dom",
      "es2015"
    ],
    "module": "es2015",
    "moduleResolution": "node",
    "sourceMap": true,
    "target": "es2015"
  },
  "include": [
    "src/**/*.ts"
  ],
  "exclude": [
    "node_modules"
  ],
  "compileOnSave": false,
  "atom": {
    "rewriteTsconfig": false
  }
}

package.json is blow:

{
    "name": "ionic-hello-world",
    "author": "Ionic Framework",
    "homepage": "http://ionicframework.com/",
    "private": true,
    "scripts": {
        "clean": "ionic-app-scripts clean",
        "build": "ionic-app-scripts build",
        "ionic:build": "ionic-app-scripts build",
        "ionic:serve": "ionic-app-scripts serve"
    },
    "dependencies": {
        "@angular/common": "2.4.8",
        "@angular/compiler": "2.4.8",
        "@angular/compiler-cli": "2.4.8",
        "@angular/core": "2.4.8",
        "@angular/forms": "2.4.8",
        "@angular/http": "2.4.8",
        "@angular/platform-browser": "2.4.8",
        "@angular/platform-browser-dynamic": "2.4.8",
        "@angular/platform-server": "2.4.8",
        "@ionic-native/barcode-scanner": "^3.6.1",
        "@ionic-native/core": "^3.6.1",
        "@ionic-native/http": "^3.4.4",
        "@ionic-native/splash-screen": "3.1.0",
        "@ionic-native/status-bar": "3.1.0",
        "@ionic/cloud-angular": "^0.12.0",
        "@ionic/storage": "^2.0.0",
        "cordova-android": "^6.2.3",
        "ionic-angular": "2.3.0",
        "ionicons": "3.0.0",
        "rxjs": "5.0.1",
        "sw-toolbox": "3.4.0",
        "zone.js": "0.7.2",
        "cordova-plugin-console": "1.0.5",
        "cordova-plugin-splashscreen": "~4.0.1",
        "cordova-plugin-statusbar": "2.2.1",
        "cordova-plugin-whitelist": "1.3.1",
        "cordova-sqlite-storage": "~2.0.2",
        "ionic-plugin-keyboard": "~2.2.1",
        "phonegap-plugin-barcodescanner": "~6.0.6"
    },
    "devDependencies": {
        "@ionic/app-scripts": "1.1.4",
        "typescript": "2.0.9"
    },
    "cordovaPlugins": [
        "cordova-plugin-whitelist",
        "cordova-plugin-splashscreen",
        "ionic-plugin-keyboard",
        "cordova-plugin-device",
        "cordova-plugin-statusbar",
        "cordova-plugin-console"
    ],
    "cordovaPlatforms": [],
    "description": "checkApp: An Ionic project",
    "cordova": {
        "plugins": {
            "cordova-plugin-console": {},
            "cordova-plugin-splashscreen": {},
            "cordova-plugin-statusbar": {},
            "cordova-plugin-whitelist": {},
            "cordova-sqlite-storage": {},
            "ionic-plugin-keyboard": {},
            "phonegap-plugin-barcodescanner": {}
        }
    }
}

Is there anything I mistake? Is there some one can help me, please? It takes me too much time : ( Thank you!