【问题标题】:Getting blank screen in IPA after updating angular cordova-ios platform更新 angular cordova-ios 平台后在 IPA 中出现黑屏
【发布时间】:2021-01-01 06:07:18
【问题描述】:

最初我们使用 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="Support@appname.com" 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>

【问题讨论】:

    标签: ios cordova uiwebview app-store-connect wkwebview


    【解决方案1】:

    不幸的是,白屏错误非常普遍,因为控制台中没有列出错误情况(请参阅Cordova - white screen after splash, no exceptions in console)。

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

    【讨论】:

    • 谢谢!我们试过这个,但似乎是一个路由问题,应用程序组件的路由器出口不会路由到 IPA 中的子组件,但在浏览器上工作正常。我们在控制台上没有发现这样的错误。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2022-07-07
    • 2020-11-12
    • 2015-05-10
    • 2021-01-04
    • 2016-02-05
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多