белый экран на ionic для ios и Android

#android #cordova #ionic-framework #cocoapods #capacitor

#Android #кордова #ionic-framework #cocoapods #конденсатор

Вопрос:

Я перепробовал все, и это отстой

Я пробовал все это в поиске Google, ничего не получалось

Я не уверен, в чем проблема, но я получил эту ошибку при выполнении этой команды «cordova run android»

 Command failed with exit code 1: /Users/aminaibrahim/Desktop/ionic_pro/platforms/android/gradlew cdvBuildDebug -b /Users/aminaibrahim/Desktop/ionic_pro/platforms/android/build.gradle
 

и эта команда ionic ‘cordova run android —prod’ выдает мне еще одну ошибку с кодом, но я не смог ее изменить, например, эта ошибка «Компонент ‘LoginPage’ объявлен более чем одним NgModule»

Вот моя функция initializeApp

 initializeApp() {
    this.platform.ready().then(() => {
      this.statusBar.styleDefault();
      // Commenting splashScreen Hide, so it won't hide splashScreen before auth check
      this.splashScreen.hide();
      this.authService.getToken();
    });
  }
 

config.xml

 <preference name="loadUrlTimeoutValue" value="700000" />
    <preference name="ScrollEnabled" value="false" />
    <preference name="BackupWebStorage" value="none" />
    <preference name="SplashMaintainAspectRatio" value="true" />
    <preference name="FadeSplashScreenDuration" value="300" />
    <preference name="SplashShowOnlyFirstTime" value="false" />
    <preference name="SplashScreen" value="screen" />
    <preference name="SplashScreenDelay" value="3000" />
    <preference name="AutoHideSplashScreen" value="false" />
    <preference name="ShowSplashScreen" value="true" />
    <preference name="ShowSplashScreenSpinner" value="false" />
    <preference name="FadeSplashScreen" value="true" />
 

Я действительно не знаю, что с этим делать

вот журналы xcode, если это поможет

 2020-11-26 13:13:42.765734 0300 MyApp[1292:3005054] Apache Cordova native platform version 6.1.1 is starting.
2020-11-26 13:13:42.766130 0300 MyApp[1292:3005054] Multi-tasking -> Device: YES, App: YES
2020-11-26 13:13:42.871102 0300 MyApp[1292:3005054] CDVWKWebViewEngine: trying to inject XHR polyfill
2020-11-26 13:13:42.925675 0300 MyApp[1292:3005054] The preference key "KeyboardResize" is not defined and will default to "TRUE"
2020-11-26 13:13:42.926209 0300 MyApp[1292:3005054] The preference key "AutoInjectCordova" is not defined and will default to "FALSE"
2020-11-26 13:13:42.926526 0300 MyApp[1292:3005054] The preference key "AudioCanMix" is not defined and will default to "FALSE"
2020-11-26 13:13:43.059379 0300 MyApp[1292:3005054] The preference key "WKSuspendInBackground" is not defined and will default to "TRUE"
2020-11-26 13:13:43.059841 0300 MyApp[1292:3005054] The preference key "MediaPlaybackAllowsAirPlay" is not defined and will default to "TRUE"
2020-11-26 13:13:46.196321 0300 MyApp[1292:3005054] The preference key "KeyboardAppearanceDark" is not defined and will default to "FALSE"
2020-11-26 13:13:46.196710 0300 MyApp[1292:3005054] The preference key "AllowLinkPreview" is not defined and will default to "FALSE"
2020-11-26 13:13:46.199612 0300 MyApp[1292:3005054] The preference key "AllowBackForwardNavigationGestures" is not defined and will default to "FALSE"
2020-11-26 13:13:46.199919 0300 MyApp[1292:3005054] CDVWKWebViewEngine will reload WKWebView if required on resume
2020-11-26 13:13:46.200447 0300 MyApp[1292:3005054] Using Ionic WKWebView
2020-11-26 13:13:46.201920 0300 MyApp[1292:3005054] [CDVTimer][console] 0.162005ms
2020-11-26 13:13:46.202530 0300 MyApp[1292:3005054] [CDVTimer][handleopenurl] 0.240922ms
2020-11-26 13:13:46.207672 0300 MyApp[1292:3005054] [CDVTimer][intentandnavigationfilter] 4.866004ms
2020-11-26 13:13:46.208236 0300 MyApp[1292:3005054] [CDVTimer][gesturehandler] 0.162005ms
2020-11-26 13:13:46.215468 0300 MyApp[1292:3005054] [CDVTimer][statusbar] 6.856918ms
2020-11-26 13:13:46.235326 0300 MyApp[1292:3005054] [CDVTimer][splashscreen] 19.553065ms
2020-11-26 13:13:46.236065 0300 MyApp[1292:3005054] The preference key "KeyboardResize" is not defined and will default to "TRUE"
2020-11-26 13:13:46.236288 0300 MyApp[1292:3005054] CDVIonicKeyboard: resize mode 1
2020-11-26 13:13:46.236477 0300 MyApp[1292:3005054] The preference key "HideKeyboardFormAccessoryBar" is not defined and will default to "TRUE"
2020-11-26 13:13:46.237487 0300 MyApp[1292:3005054] The preference key "KeyboardAppearanceDark" is not defined and will default to "FALSE"
2020-11-26 13:13:46.237760 0300 MyApp[1292:3005054] [CDVTimer][cdvionickeyboard] 2.089024ms
2020-11-26 13:13:46.238123 0300 MyApp[1292:3005054] [CDVTimer][inappbrowser] 0.163078ms
2020-11-26 13:13:46.238320 0300 MyApp[1292:3005054] [CDVTimer][TotalPluginStartup] 36.702037ms
2020-11-26 13:13:47.084315 0300 MyApp[1292:3005054] WF: === Starting WebFilter logging for process MyApp
2020-11-26 13:13:47.084608 0300 MyApp[1292:3005054] WF: _userSettingsForUser : (null)
2020-11-26 13:13:47.087678 0300 MyApp[1292:3005054] WF: _WebFilterIsActive returning: NO
2020-11-26 13:13:49.739303 0300 MyApp[1292:3005054] IAB.close() called but it was already closed.
2020-11-26 13:13:53.227267 0300 MyApp[1292:3005054] The preference key "AutoHideSplashScreen" is not defined and will default to "TRUE"
2020-11-26 13:13:53.302114 0300 MyApp[1292:3005054] Ionic Native: deviceready event fired after 1840 ms
2020-11-26 13:14:33.714891 0300 MyApp[1292:3005054] CDVWKWebViewEngine shouldReloadWebView::
2020-11-26 13:14:33.715287 0300 MyApp[1292:3005054] CDVWKWebViewEngine shouldReloadWebView title: Ionic App
2020-11-26 13:14:33.715499 0300 MyApp[1292:3005054] CDVWKWebViewEngine shouldReloadWebView location: ionic://localhost/landing
2020-11-26 13:14:33.715680 0300 MyApp[1292:3005054] CDVWKWebViewEngine shouldReloadWebView reload: 0
2020-11-26 13:32:17.248233 0300 MyApp[1292:3005054] CDVWKWebViewEngine shouldReloadWebView::
2020-11-26 13:32:17.249577 0300 MyApp[1292:3005054] CDVWKWebViewEngine shouldReloadWebView title: Ionic App
2020-11-26 13:32:17.250518 0300 MyApp[1292:3005054] CDVWKWebViewEngine shouldReloadWebView location: ionic://localhost/landing
2020-11-26 13:32:17.251447 0300 MyApp[1292:3005054] CDVWKWebViewEngine shouldReloadWebView reload: 0

 

Ответ №1:

CDVWKWebViewEngine должен загружать WebView

Это указывает на то, что вам, возможно, понадобится плагин inappbrowser.

Для iOS убедитесь, что в ваш проект cordova добавлен inappbrowser. В терминале измените каталог на корневой каталог вашего проекта Cordova:

 cordova plugin add cordova-plugin-inappbrowser
 

Также убедитесь, что цель развертывания для iOS в config.xml составляет 11

 <preference name="deployment-target" value="11.0" />
 

Cordova-ios @ 6 использует функцию scheme для решения множества проблем с перекрестным происхождением в WKWebView, для чего требуется iOS 11.

Вот причина, по которой это значение равно 11. Приведенная выше цитата из репозитория GitHub