白屏离子 v6.11.8 电容器

white screen ionic v6.11.8 capacitor

因为我正在尝试使用以下命令通过电容器 运行 应用程序。

ionic capacitor run android

android studio 4.2 canary 11 中 运行 成功 运行 我的模拟器在 Pixel 上或通过移动 USB调试模式在电容器闪屏后给我 白屏 。如果我使用 chrome chrome://inspect/#devices 它会显示我的应用程序 运行ning 并且当我看到我的控制台时它还会显示 console.log('dangggggggggggg');initializeApp() 中但我只看到白屏。我浏览了很多页面寻求帮助,但我仍然无法弄清楚它是什么问题,因为 chrome 调试器也没有在其中显示错误。下面是屏幕截图。

这是我关注的 Url。

https://forum.ionicframework.com/t/white-screen-when-using-capacitor/183825/3
https://github.com/ionic-team/capacitor/issues/960

因为我使用的是 android canary 而不是常规工作室,因为 AMD 处理器。

将我的路由从指向空白页面的 'home' 更改为我需要查看的页面。这是一个非常令人困惑的问题,但它完全存在于我的 angular 应用程序路由中。

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)
  },

对我来说,问题出在 capacitor.config.json 中的 webDir 道具,替换为 www 然后就可以了。

Ionic Capacitor App Blank/White Screen Problem