ionic v3 build IOS 上传到应用商店时出现“UIWebView”错误
Posted
技术标签:
【中文标题】ionic v3 build IOS 上传到应用商店时出现“UIWebView”错误【英文标题】:ionic v3 build IOS get error “UIWebView” when upload to app store 【发布时间】:2020-08-19 00:40:11 【问题描述】:我开发了 ionic v3 应用程序,当我构建应用程序被拒绝时,我想将其上传到应用商店。
我们发现您的应用最近交付的一个或多个问题。 请更正以下问题,然后重新上传。以下 苹果发送给我的电子邮件。
ITMS-90809:不推荐使用的 API 使用 - 使用 UIWebView 的新应用不可用 较长时间接受。相反,使用 WKWebView 来提高安全性和 可靠性。学到更多 (https://developer.apple.com/documentation/uikit/uiwebview)。
但我没有使用蓝牙并使用一个信号。 我使用这个question 删除 UIWebView 但得到同样的错误。
我的 package.json
"private": true,
"scripts":
"clean": "ionic-app-scripts clean",
"build": "ionic-app-scripts build",
"lint": "ionic-app-scripts lint",
"ionic:build": "ionic-app-scripts build",
"ionic:serve": "ionic-app-scripts serve"
,
"dependencies":
"@angular/animations": "^4.4.7",
"@angular/common": "5.0.3",
"@angular/compiler": "5.0.3",
"@angular/compiler-cli": "5.0.3",
"@angular/core": "5.0.3",
"@angular/forms": "5.0.3",
"@angular/http": "5.0.3",
"@angular/platform-browser": "5.0.3",
"@angular/platform-browser-dynamic": "5.0.3",
"@ionic-native/admob-free": "^4.20.0",
"@ionic-native/app-version": "4.18.0",
"@ionic-native/camera": "4.18.0",
"@ionic-native/core": "4.18.0",
"@ionic-native/deeplinks": "^4.20.0",
"@ionic-native/device": "4.18.0",
"@ionic-native/email-composer": "4.18.0",
"@ionic-native/facebook": "^4.20.0",
"@ionic-native/fcm": "^4.20.0",
"@ionic-native/geofence": "^4.20.0",
"@ionic-native/geolocation": "^4.20.0",
"@ionic-native/google-plus": "4.18.0",
"@ionic-native/in-app-browser": "^4.18.0",
"@ionic-native/ionic-webview": "^5.28.0",
"@ionic-native/local-notifications": "4.18.0",
"@ionic-native/native-geocoder": "^4.20.0",
"@ionic-native/network": "4.18.0",
"@ionic-native/onesignal": "4.18.0",
"@ionic-native/paypal": "4.18.0",
"@ionic-native/push": "^4.20.0",
"@ionic-native/social-sharing": "4.18.0",
"@ionic-native/spinner-dialog": "4.18.0",
"@ionic-native/splash-screen": "4.18.0",
"@ionic-native/status-bar": "4.18.0",
"@ionic-native/stripe": "4.18.0",
"@ionic-native/toast": "4.18.0",
"@ionic/storage": "2.1.3",
"@ngx-translate/core": "^9.1.1",
"@ngx-translate/http-loader": "^0.1.0",
"cordova-admob-sdk": "^0.24.1",
"cordova-android": "7.1.4",
"cordova-ios": "^5.1.1",
"cordova-plugin-add-swift-support": "^2.0.2",
"cordova-plugin-admob-free": "^0.27.0",
"cordova-plugin-app-version": "^0.1.9",
"cordova-plugin-badge": "^0.8.8",
"cordova-plugin-device": "^1.1.7",
"cordova-plugin-email-composer": "^0.8.15",
"cordova-plugin-facebook4": "5.0.0",
"cordova-plugin-geolocation": "^4.0.2",
"cordova-plugin-inappbrowser": "^4.0.0",
"cordova-plugin-ionic-webview": "^5.0.0",
"cordova-plugin-local-notification": "0.9.0-beta.2",
"cordova-plugin-native-spinner": "^1.1.3",
"cordova-plugin-nativegeocoder": "^3.2.2",
"cordova-plugin-network-information": "^1.3.4",
"cordova-plugin-splashscreen": "^4.0.3",
"cordova-plugin-statusbar": "^2.4.3",
"cordova-plugin-whitelist": "^1.3.4",
"cordova-plugin-x-socialsharing": "^5.6.8",
"cordova-promise-polyfill": "0.0.2",
"cordova-support-google-services": "^1.3.2",
"css-animator": "^2.3.1",
"es6-promise-plugin": "^4.2.2",
"ionic-angular": "3.9.2",
"ionic-img-viewer": "^2.9.0",
"ionic-plugin-deeplinks": "^1.0.20",
"ionic-plugin-keyboard": "^2.2.1",
"ionicons": "3.0.0",
"jquery": "^3.4.1",
"ng-lazyload-image": "^3.4.2",
"onesignal-cordova-plugin": "^2.8.3",
"phonegap-plugin-multidex": "^1.0.0",
"phonegap-plugin-push": "^2.3.0",
"rxjs": "5.5.2",
"sw-toolbox": "3.6.0",
"web-animations-js": "^2.3.2",
"woocommerce-api": "^1.5.0",
"zone.js": "0.8.18"
,
"devDependencies":
"@ionic/app-scripts": "^3.2.4",
"@ionic/cli-plugin-cordova": "1.4.1",
"@ionic/cli-plugin-ionic-angular": "1.4.1",
"@ionic/lab": "2.0.10",
"typescript": "2.4.2"
,
"description": "An Ionic project",
"cordova":
"plugins":
"ionic-plugin-keyboard": ,
"cordova-plugin-device": ,
"cordova-plugin-splashscreen": ,
"cordova-plugin-network-information": ,
"cordova-plugin-app-version": ,
"cordova-plugin-statusbar": ,
"cordova-plugin-native-spinner": ,
"cordova-plugin-whitelist": ,
"cordova-plugin-email-composer": ,
"onesignal-cordova-plugin": ,
"cordova-plugin-geolocation":
"GEOLOCATION_USAGE_DESCRIPTION": "To locate you"
,
"cordova-plugin-nativegeocoder":
"LOCATION_WHEN_IN_USE_DESCRIPTION": "Use geocoder service"
,
"ionic-plugin-deeplinks":
"URL_SCHEME": "myapp",
"DEEPLINK_SCHEME": "https",
"DEEPLINK_HOST": "aromixgroup.com",
"ANDROID_PATH_PREFIX": "/",
"ANDROID_2_PATH_PREFIX": "/",
"ANDROID_3_PATH_PREFIX": "/",
"ANDROID_4_PATH_PREFIX": "/",
"ANDROID_5_PATH_PREFIX": "/",
"DEEPLINK_2_SCHEME": " ",
"DEEPLINK_2_HOST": " ",
"DEEPLINK_3_SCHEME": " ",
"DEEPLINK_3_HOST": " ",
"DEEPLINK_4_SCHEME": " ",
"DEEPLINK_4_HOST": " ",
"DEEPLINK_5_SCHEME": " ",
"DEEPLINK_5_HOST": " "
,
"cordova-plugin-facebook4":
"FACEBOOK_HYBRID_APP_EVENTS": "false",
"FACEBOOK_ANDROID_SDK_VERSION": "5.0.2"
,
"cordova-plugin-admob-free":
,
"cordova-plugin-local-notification": ,
"phonegap-plugin-push":
"ANDROID_SUPPORT_V13_VERSION": "27.+",
"FCM_VERSION": "17.0.+"
,
"cordova-plugin-add-swift-support": ,
"cordova-plugin-inappbrowser": ,
"cordova-plugin-x-socialsharing":
"PHOTO_LIBRARY_ADD_USAGE_DESCRIPTION": "This app requires photo library access to function properly.",
"PHOTO_LIBRARY_USAGE_DESCRIPTION": "This app requires photo library access to function properly."
,
"cordova-plugin-ionic-webview":
,
"platforms": [
"android",
"ios"
]
config.xml
<?xml version='1.0' encoding='utf-8'?>
<widget version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<content src="index.html" />
<access origin="*" />
<allow-navigation href="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
<preference name="scheme" value="app" />
<preference name="hostname" value="localhost" />
<preference name="ScrollEnabled" value="false" />
<preference name="android-minSdkVersion" value="16" />
<preference name="android-targetSdkVersion" value="29" />
<preference name="BackupWebStorage" value="none" />
<preference name="SplashMaintainAspectRatio" value="true" />
<preference name="FadeSplashScreenDuration" value="300" />
<preference name="SplashShowOnlyFirstTime" value="false" />
<preference name="AutoHideSplashScreen" value="false" />
<preference name="orientation" value="portrait" />
<preference name="SplashScreen" value="screen" />
<preference name="SplashScreenDelay" value="3000" />
<preference name="loadUrlTimeoutValue" value="700000" />
<preference name="WKWebViewOnly" value="true" />
<feature name="CDVWKWebViewEngine">
<param name="ios-package" value="CDVWKWebViewEngine" />
</feature>
<preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />
<platform name="android">
<allow-intent href="market:*" />
<icon density="ldpi" src="resources/android/icon/drawable-ldpi-icon.png" />
<icon density="mdpi" src="resources/android/icon/drawable-mdpi-icon.png" />
<icon density="hdpi" src="resources/android/icon/drawable-hdpi-icon.png" />
<icon density="xhdpi" src="resources/android/icon/drawable-xhdpi-icon.png" />
<icon density="xxhdpi" src="resources/android/icon/drawable-xxhdpi-icon.png" />
<icon density="xxxhdpi" src="resources/android/icon/drawable-xxxhdpi-icon.png" />
<splash density="land-ldpi" src="resources/android/splash/drawable-land-ldpi-screen.png" />
<splash density="land-mdpi" src="resources/android/splash/drawable-land-mdpi-screen.png" />
<splash density="land-hdpi" src="resources/android/splash/drawable-land-hdpi-screen.png" />
<splash density="land-xhdpi" src="resources/android/splash/drawable-land-xhdpi-screen.png" />
<splash density="land-xxhdpi" src="resources/android/splash/drawable-land-xxhdpi-screen.png" />
<splash density="land-xxxhdpi" src="resources/android/splash/drawable-land-xxxhdpi-screen.png" />
<splash density="port-ldpi" src="resources/android/splash/drawable-port-ldpi-screen.png" />
<splash density="port-mdpi" src="resources/android/splash/drawable-port-mdpi-screen.png" />
<splash density="port-hdpi" src="resources/android/splash/drawable-port-hdpi-screen.png" />
<splash density="port-xhdpi" src="resources/android/splash/drawable-port-xhdpi-screen.png" />
<splash density="port-xxhdpi" src="resources/android/splash/drawable-port-xxhdpi-screen.png" />
<splash density="port-xxxhdpi" src="resources/android/splash/drawable-port-xxxhdpi-screen.png" />
</platform>
<platform name="ios">
<allow-intent href="itms:*" />
<allow-intent href="itms-apps:*" />
<preference name="WKWebViewOnly" value="true" />
<feature name="CDVWKWebViewEngine">
<param name="ios-package" value="CDVWKWebViewEngine" />
</feature>
<access origin="ionic://localhost" />
<allow-navigation href="ionic://localhost/*" />
<preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />
<icon src="resources/ios/icon/icon.png" />
<icon src="resources/ios/icon/icon@2x.png" />
<icon src="resources/ios/icon/icon-40.png" />
<icon src="resources/ios/icon/icon-40@2x.png" />
<icon src="resources/ios/icon/icon-40@3x.png" />
<icon src="resources/ios/icon/icon-50.png" />
<icon src="resources/ios/icon/icon-50@2x.png" />
<icon src="resources/ios/icon/icon-60.png" />
<icon src="resources/ios/icon/icon-60@2x.png" />
<icon src="resources/ios/icon/icon-60@3x.png" />
<icon src="resources/ios/icon/icon-72.png" />
<icon src="resources/ios/icon/icon-72@2x.png" />
<icon src="resources/ios/icon/icon-76.png" />
<icon src="resources/ios/icon/icon-76@2x.png" />
<icon src="resources/ios/icon/icon-83.5@2x.png" />
<icon src="resources/ios/icon/icon-small.png" />
<icon src="resources/ios/icon/icon-small@2x.png" />
<icon src="resources/ios/icon/icon-small@3x.png" />
<icon src="resources/ios/icon/icon-1024.png" />
<splash src="resources/ios/splash/Default-568h@2x~iphone.png" />
<splash src="resources/ios/splash/Default-667h.png" />
<splash src="resources/ios/splash/Default-736h.png" />
<splash src="resources/ios/splash/Default-Landscape-736h.png" />
<splash src="resources/ios/splash/Default-Landscape@2x~ipad.png" />
<splash src="resources/ios/splash/Default-Landscape@~ipadpro.png" />
<splash src="resources/ios/splash/Default-Landscape~ipad.png" />
<splash src="resources/ios/splash/Default-Portrait@2x~ipad.png" />
<splash src="resources/ios/splash/Default-Portrait@~ipadpro.png" />
<splash src="resources/ios/splash/Default-Portrait~ipad.png" />
<splash src="resources/ios/splash/Default@2x~iphone.png" />
<splash src="resources/ios/splash/Default~iphone.png" />
<splash src="resources/ios/splash/Default@2x~universal~anyany.png" />
<icon src="resources/ios/icon/icon-20.png" />
<icon src="resources/ios/icon/icon-20@2x.png" />
<icon src="resources/ios/icon/icon-20@3x.png" />
<icon src="resources/ios/icon/icon-29.png" />
<icon src="resources/ios/icon/icon-29@2x.png" />
<icon src="resources/ios/icon/icon-29@3x.png" />
<icon src="resources/ios/icon/icon-24@2x.png" />
<icon src="resources/ios/icon/icon-27.5@2x.png" />
<icon src="resources/ios/icon/icon-44@2x.png" />
<icon src="resources/ios/icon/icon-86@2x.png" />
<icon src="resources/ios/icon/icon-98@2x.png" />
<icon src="resources/ios/icon/icon-108@2x.png" />
<splash src="resources/ios/splash/Default-2688h~iphone.png" />
<splash src="resources/ios/splash/Default-Landscape-2688h~iphone.png" />
<splash src="resources/ios/splash/Default-1792h~iphone.png" />
<splash src="resources/ios/splash/Default-Landscape-1792h~iphone.png" />
<splash src="resources/ios/splash/Default-2436h.png" />
<splash src="resources/ios/splash/Default-Landscape-2436h.png" />
<edit-config file="*-Info.plist" mode="merge" target="NSLocationWhenInUseUsageDescription">
<string>We use your location for full functionality of certain app features.</string>
</edit-config>
<edit-config file="*-Info.plist" mode="merge" target="NSLocationAlwaysUsageDescription">
<string>We use your location for full functionality of certain app features.</string>
</edit-config>
</platform>
<allow-navigation href="http://192.168.100.8:8100" />
<allow-navigation href="http://192.168.100.6:8101" />
<allow-navigation href="http://192.168.100.12:8101" />
<edit-config file="*-Info.plist" mode="merge" target="NSLocationWhenInUseUsageDescription">
<string>We use your location for full functionality of certain app features.</string>
</edit-config>
<edit-config file="*-Info.plist" mode="merge" target="NSLocationAlwaysUsageDescription">
<string>We use your location for full functionality of certain app features.</string>
</edit-config>
<allow-navigation href="http://192.168.43.185:8100" sessionid="e88ac2f5" />
<allow-navigation href="http://localhost:8100" sessionid="9ac4c3b8" />
<engine name="android" spec="7.1.4" />
<plugin name="ionic-plugin-keyboard" spec="^2.2.1" />
<plugin name="cordova-plugin-device" spec="^1.1.7" />
<plugin name="cordova-plugin-splashscreen" spec="^4.0.3" />
<plugin name="cordova-plugin-network-information" spec="^1.3.4" />
<plugin name="cordova-plugin-app-version" spec="^0.1.9" />
<plugin name="cordova-plugin-statusbar" spec="^2.4.3" />
<plugin name="cordova-plugin-native-spinner" spec="^1.1.3" />
<plugin name="cordova-plugin-whitelist" spec="^1.3.4" />
<plugin name="cordova-plugin-email-composer" spec="^0.8.15" />
<plugin name="onesignal-cordova-plugin" spec="^2.8.3" />
<plugin name="cordova-plugin-geolocation" spec="^4.0.2">
<variable name="GEOLOCATION_USAGE_DESCRIPTION" value="To locate you" />
</plugin>
<plugin name="cordova-plugin-nativegeocoder" spec="^3.2.2">
<variable name="LOCATION_WHEN_IN_USE_DESCRIPTION" value="Use geocoder service" />
</plugin>
<plugin name="ionic-plugin-deeplinks" spec="^1.0.20">
<variable name="URL_SCHEME" value="myapp" />
<variable name="DEEPLINK_SCHEME" value="https" />
<variable name="DEEPLINK_HOST" value="aromixgroup.com" />
<variable name="ANDROID_PATH_PREFIX" value="/" />
<variable name="ANDROID_2_PATH_PREFIX" value="/" />
<variable name="ANDROID_3_PATH_PREFIX" value="/" />
<variable name="ANDROID_4_PATH_PREFIX" value="/" />
<variable name="ANDROID_5_PATH_PREFIX" value="/" />
<variable name="DEEPLINK_2_SCHEME" value=" " />
<variable name="DEEPLINK_2_HOST" value=" " />
<variable name="DEEPLINK_3_SCHEME" value=" " />
<variable name="DEEPLINK_3_HOST" value=" " />
<variable name="DEEPLINK_4_SCHEME" value=" " />
<variable name="DEEPLINK_4_HOST" value=" " />
<variable name="DEEPLINK_5_SCHEME" value=" " />
<variable name="DEEPLINK_5_HOST" value=" " />
</plugin>
<plugin name="cordova-plugin-facebook4" spec="5.0.0">
<variable name="APP_NAME" value="aromixgroup" />
<variable name="FACEBOOK_HYBRID_APP_EVENTS" value="false" />
<variable name="FACEBOOK_ANDROID_SDK_VERSION" value="5.0.2" />
</plugin>
<plugin name="cordova-plugin-admob-free" spec="^0.27.0">
</plugin>
</widget>
【问题讨论】:
您使用的是什么版本的 Cordova?更新您的科尔多瓦 CLInpm i -g cordova@latest
并删除平台添加再次添加它。
我会试试,希望能解决问题。
没有解决问题能再给点提示吗?
我使用的离子网络视图版本 5.0.0 cordova v10 cordova-ios v 5.0.0
【参考方案1】:
尝试添加这个 cordova-ios 版本:
ionic cordova platform add ios@5.0.0
我遇到了同样的问题,我可以用这个版本上传我的应用
【讨论】:
不解决问题 ionic web view version that I use 5.0.0 cordova v10 cordova-ios v 5.0.0【参考方案2】:好吧,我在一个正在运行的高效应用程序上也遇到了这个问题。 Apple 不希望您在应用中使用任何 UIWebView 引用。
解决方案 1(正确) 将使用您获得的所有插件更新您的整个 Ionic 项目,其中仍有一些 UIWebView 引用。这可能需要一段时间,甚至是不可能的,因为我遇到了很多过时的插件,没有人正确更新它。
我仍然使用 Ionic 3 的方式
在你的构建脚本中(我会做一个而不是总是在你的 bash 中输入所有命令)添加科尔多瓦平台版本 5.1.1。对我来说,只有这个版本运行良好,仍然与 Ionic 3 插件兼容,Apple 不再向我发送此消息。
然后做一个 ionic cordova 准备 ios/android。
这应该可以解决问题:
ionic cordova platform add ios@5.1.1
ionic cordova prepare ios
然后您可以在 xCode 上再次打开它并尝试再次提交您的应用。
希望对你有所帮助!
【讨论】:
我多次尝试使用解决方案 2 中的命令,但仍然给出相同的消息 对于解决方案一,您的意思是删除所有插件并重新安装以上是关于ionic v3 build IOS 上传到应用商店时出现“UIWebView”错误的主要内容,如果未能解决你的问题,请参考以下文章
运行 ionic cordova build ios 时找不到包含的文件
Ionic React App IOS Build 失败“配置文件”
ionic cordova build ios 使用 xcode swift 3 框架安装自定义插件失败