构建后的空白页ionic2

时间:2017-02-16 17:51:09

标签: cordova angular ionic-framework ionic2

通过以下命令:

ionic platform add android
ionic build android

我添加了平台&内置APK文件但我在手机上运行应用程序时遇到了空白屏幕。软件在ionic serve中正常运行 调试时没有任何错误。 我也有离子的建议应用程序的问题

ionic start --v2 myApp sidemenu 

提前感谢您的帮助!

2 个答案:

答案 0 :(得分:1)

在您的“config.xml”文件中,在项目的根目录中添加此首选项:

<preference name="ShowSplashScreenSpinner" value="false" />
<preference name="SplashScreen" value="screen" />
<preference name="SplashScreenDelay" value="20000" />
<preference name="FadeSplashScreen" value="true" />
<preference name="FadeSplashScreenDuration" value="300" />
<preference name="SplashScreenBackgroundColor" value="false" />

答案 1 :(得分:1)

我会确保您拥有最新版本的npm和node。

然后确保您拥有最新版本的Ionic(2.2)

为此,您应该更新package.json文件..

"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/storage": "2.0.0",
    "ionic-angular": "2.2.0",
    "ionic-native": "2.4.1",
    "ionicons": "3.0.0",
    "rxjs": "5.0.1",
    "sw-toolbox": "3.4.0",
    "zone.js": "0.7.2"
},
"devDependencies": {
    "@ionic/app-scripts": "1.1.4",
    "typescript": "2.0.9"
}

然后删除node_modules目录,然后运行:

npm install(或者可能是sudo npm install)

这应该更新所有内容并希望解决问题