ios - 更新 Angular cordova-ios 平台后,IPA 中出现空白屏幕

标签 ios cordova uiwebview app-store-connect wkwebview

最初我们使用 Angular cordova-ios 版本为 4.5.4,在将 IPA 上传到 Apple Store Connect 时,出现了 UIWebView 错误,因此将 cordova-ios 平台升级到 5.1.1 并添加了 cordova-plugin-wkwebview-engine插入。现在生成 IPA 时,它显示空白屏幕并且不会路由到登录屏幕。

版本详情如下:

angular-devkit/architect         0.10.7
@angular-devkit/build-angular     0.10.7
@angular-devkit/build-optimizer   0.10.7
@angular-devkit/build-webpack     0.10.7
@angular-devkit/core              7.0.7
@angular-devkit/schematics        0.8.9
@angular/cli                      6.2.9
@ngtools/webpack                  7.0.7
@schematics/angular               0.8.9
@schematics/update                0.8.9
rxjs                              5.5.12
typescript                        2.9.2
webpack                           4.19.1
cordova-ios                       5.1.1

我们使用以下命令来构建:

ng build --prod --source-map=false && cordova build ios

我们的 config.xml 文件

<?xml version='1.0' encoding='utf-8'?>
<widget android-activityName="appname" android-versionCode="10002" id="appname" version="1.0.2" xmlns="http://www.w3.org/ns/widgets" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:cdv="http://cordova.apache.org/ns/1.0">
    <name>appname</name>
    <description>
         Description
    </description>
    <author email="<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="1b486e6b6b74696f5b7a6b6b757a767e35787476" rel="noreferrer noopener nofollow">[email protected]</a>" href="http://appname.com">
        appname
    </author>
    <content src="index.html" />
    <allow-navigation href="*" />
    <allow-intent href="*" />
    <access origin="*" />
    <edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application">
        <application android:usesCleartextTraffic="true" />
    </edit-config>
    <allow-intent href="http://*/*" />
    <allow-intent href="https://*/*" />
    <allow-intent href="tel:*" />
    <allow-intent href="sms:*" />
    <allow-intent href="mailto:*" />
    <allow-intent href="geo:*" />
    <platform name="android">
        <allow-intent href="market:*" />
        <icon density="ldpi" src="res/icon/android/ldpi.png" />
        <preference name="CustomURLSchemePluginClearsAndroidIntent" value="true" />
    </platform>
    <platform name="ios">
        <allow-intent href="itms:*" />
        <allow-intent href="itms-apps:*" />
        <icon density="ldpi" src="res/icon/android/ldpi.png" />
    </platform>
    <hook src="hooks/appBeforeBuild.js" type="before_build" />
    <hook src="hooks/appBeforeBuild.js" type="before_run" />
    <engine name="browser" spec="^5.0.3" />
    <plugin name="cordova-plugin-dbcopy" spec="^2.1.2" />
    <plugin name="cordova-plugin-whitelist" spec="^1.3.3" />
    <plugin name="cordova-plugin-network-information" spec="^2.0.1" />
    <plugin name="uk.co.workingedge.cordova.plugin.sqliteporter" spec="^1.1.0" />
    <plugin name="cordova-plugin-device" spec="^2.0.2" />
    <plugin name="cordova-plugin-printer" spec="^0.7.3" />
    <plugin name="cordova-plugin-file-transfer" spec="^1.7.1" />
    <plugin name="cordova-plugin-customurlscheme" spec="^4.4.0">
        <variable name="URL_SCHEME" value="URL_SCHEME_NAME" />
        <variable name="ANDROID_SCHEME" value=" " />
        <variable name="ANDROID_HOST" value=" " />
        <variable name="ANDROID_PATHPREFIX" value="/" />
    </plugin>
    <plugin name="cordova-plugin-dialogs" spec="^1.3.3" />
    <plugin name="cordova-plugin-bluetoothle" spec="^4.5.10" />
    <plugin name="cordova-plugin-bluetooth-peripheral-usage-description" spec="^1.0.1">
        <variable name="TEXT" value="Some string" />
    </plugin>
    <plugin name="cordova-plugin-geolocation" spec="^4.0.2" />
    <plugin name="cordova-plugin-android-permissions" spec="^1.0.2" />
    <plugin name="cordova-plugin-ble-central" spec="^1.2.5" />
    <plugin name="cordova-plugin-inappbrowser" spec="^3.2.0" />
    <plugin name="cordova-plugin-permission" spec="^0.1.0" />
    <plugin name="cordova-plugin-vibration" spec="^3.1.1" />
</widget>

最佳答案

不幸的是,白屏错误非常常见,因为错误条件未在控制台中列出(请参阅 Cordova - white screen after splash, no exceptions in console )。

但是,您可以在 iOS 模拟器中启动应用程序并将其连接到 Safari 的开发工具,然后点击刷新。它应该会排除 iOS 遇到的异常。

关于ios - 更新 Angular cordova-ios 平台后,IPA 中出现空白屏幕,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63885653/

相关文章:

objective-c - UITableViewController的表调整大小

ios - 无法快速添加 IBOutlet

java - 如何隐藏状态栏 - Android

android - 需要通过 Facebook 和 Twitter 验证用户(PhonegapAndroid)

jquery - 我应该在 WebView 上使用 Regx、插入 JQuery 或 HTML 解析来获取其内容吗?

ios - Google Maps IOS SDK 可以免费使用吗?

ios - Xcode新手如何创建类

javascript - Ionic Framework (AngularJS) 和数据库 SQLite 3

javascript - 如何将实时数据发送到从 iOS 应用程序加载到 UIWebView 中的页面

iphone - 为什么 UIWebView 不断检测电话号码?