白屏离子v6.11.8电容器

问题描述

当我尝试使用以下命令通过电容器运行应用程序时。

ionic capacitor run android

当我在像素上或通过移动USB调试模式运行模拟器时,它成功在 android studio 4.2 canary 11 中运行,它为我提供了 白屏 在电容器启动画面之后。如果我使用Chrome chrome://inspect/#devices,它将显示我的应用程序正在运行,并且在控制台上也显示console.log('dangggggggggggg');,它位于initializeApp()内,但我只能看到白屏。我浏览了许多页面以寻求帮助,但是由于chrome调试器也没有显示错误,因此我仍然无法弄清它的问题。这是下面的屏幕截图。

white screen

这是我遵循的网址。
Why white screen stuck after splash screen in Ionic 4?
https://forum.ionicframework.com/t/white-screen-when-using-capacitor/183825/3
https://github.com/ionic-team/capacitor/issues/960

由于AMD处理器,我使用的是Android canary而不是常规工作室。

解决方法

将“路由”从“主页”(指向空白页面)更改为我需要查看的页面。这确实是一个令人困惑的问题,但它完全掩盖了我的角度应用路由。

https://forum.ionicframework.com/t/ionic-v5-capacitor-white-screen/196825/3

这是我下面的代码,它指向空白页。

{
    path: '',redirectTo: 'home',// It pointed to the blank page
    pathMatch: 'full'
  },{
    path: 'recipes',// Used this to run the start page and it worked
    children:[{
      path: '',loadChildren: () => import('./recipes/recipes.module').then(m => m.RecipesPageModule)
    },{
      path: ':recipeId',loadChildren: () => import('./recipes/recipe-detail/recipe-detail.module').then(m => m.RecipeDetailPageModule)
    }
  ]
  m.RecipesPageModule)
  },
,

对我来说,问题在于webDir中的capacitor.config.json道具,被替换为www才起作用。

Ionic Capacitor App Blank/White Screen Problem

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...