【问题标题】:White screen after splash screen in IonicIonic 启动画面后的白屏
【发布时间】:2021-06-11 13:42:54
【问题描述】:

当我在 Emulator (Android API 23 - Android 6.0) 中使用 Android Studio 运行我的 android 应用程序时,在 splashScreen 之后屏幕停留在白屏上。

我尝试了所有可以在网络上看到的解决方案,但暂时没有...

这是一个新的空白应用,我不添加新的组件或页面。

White screen in emulator

如果我在其他模拟器(Android API 30 - Android 11)中启动相同的应用程序,该应用程序可以工作:

Emulator 2 work

请问有什么解决方案吗? :)

离子信息:

Ionic:

   Ionic CLI                     : 5.4.16
   Ionic Framework               : @ionic/angular 5.6.9
   @angular-devkit/build-angular : 12.0.4
   @angular-devkit/schematics    : 12.0.4
   @angular/cli                  : 12.0.4
   @ionic/angular-toolkit        : 4.0.0

Cordova:

   Cordova CLI       : 10.0.0
   Cordova Platforms : android 9.1.0
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.2.1, (and 4 other plugins)

Utility:

   cordova-res : 0.15.3
   native-run  : 1.4.0

System:

   Android SDK Tools : 26.1.1 (C:\Users\dimit\AppData\Local\Android\Sdk)
   NodeJS            : v14.16.1 (C:\laragon\bin\nodejs\node-v14\node.exe)
   npm               : 6.14.12
   OS                : Windows 10

【问题讨论】:

  • 感谢您发布您的解决方案。仅供参考,如果您的目标 API 低于 29,您将无法在 Play Store 上发布应用。

标签: android cordova ionic-framework


【解决方案1】:

经过长时间的搜索,我找到了解决方案。

在 tsconfig.json 文件中,将 target 替换为 "es5" :

{
  "compileOnSave": false,
  "compilerOptions": {
    "baseUrl": "./",
    "outDir": "./dist/out-tsc",
    "sourceMap": true,
    "declaration": false,
    "downlevelIteration": true,
    "experimentalDecorators": true,
    "moduleResolution": "node",
    "importHelpers": true,
    "target": "es5",
    "module": "es2020",
    "lib": ["es2018", "dom"]
  },
  "angularCompilerOptions": {
    "enableI18nLegacyMessageIdFormat": false,
    "strictInjectionParameters": true,
    "strictInputAccessModifiers": true,
    "strictTemplates": true
  }
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-07-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-06-06
    • 1970-01-01
    相关资源
    最近更新 更多