ionic 3 ITMS-90809: Deprecated API Usage - iOS 5.1.1 - ios

When I’m uploading a build to AppStoreConnect (to test it via
TestFlight for example), I’m getting the well-known deprecation
message:
ITMS-90809: Deprecated API Usage - New apps that use
UIWebView are no longer accepted. Instead, use WKWebView for
improved security and reliability. Learn more
(https://developer.apple.com/documentation/uikit/uiwebview).
What I did:
1) Remove ios platform and added V5.1.0 ios platform.
2) Added below in config.xml
3) Ran ionic cordova build ios
List of cordova plugins I’m using:
cordova-plugin-add-swift-support 2.0.2 "AddSwiftSupport"
cordova-plugin-camera 4.1.0 "Camera"
cordova-plugin-chooser 1.2.6 "Chooser"
cordova-plugin-contacts 3.0.1 "Contacts"
cordova-plugin-device 2.0.2 "Device"
cordova-plugin-file 6.0.2 "File"
cordova-plugin-file-transfer 1.7.1 "File Transfer"
cordova-plugin-filepath 1.5.8 "cordova-plugin-filepath"
cordova-plugin-googleplus 5.2.1 "Google SignIn"
cordova-plugin-ionic-keyboard 2.2.0 "cordova-plugin-ionic-keyboard"
cordova-plugin-ionic-webview 4.2.1 "cordova-plugin-ionic-webview"
cordova-plugin-media-capture 3.0.3 "Capture"
cordova-plugin-splashscreen 5.0.2 "Splashscreen"
cordova-plugin-statusbar 2.4.2 "StatusBar"
cordova-plugin-stripe 1.5.3 "cordova-plugin-stripe"
cordova-plugin-telerik-imagepicker 2.3.3 "ImagePicker"
cordova-plugin-video-editor 1.1.3 "VideoEditor"
cordova-plugin-whitelist 1.3.3 "Whitelist"
ionic-plugin-deeplinks 1.0.20 "Ionic Deeplink Plugin"
Ionic Info:
Ionic:
ionic (Ionic CLI) : 4.10.3 (/usr/local/lib/node_modules/ionic) Ionic Framework :
enter code here
ionic-angular 3.9.9 #ionic/app-scripts : 3.2.4
Cordova:
cordova (Cordova CLI) : 8.1.2 (cordova-lib#8.1.1)
Cordova
Platforms : ios 5.1.0
Cordova Plugins :
cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview
4.2.1, (and 17 other plugins)
System:
ios-deploy : 1.9.4 ios-sim : 8.0.2
NodeJS : v10.15.1 (/usr/local/bin/node)
npm : 6.4.1
OS : macOS Mojave
Xcode : Xcode 11.3.1 Build version 11C504
Does anybody have an idea what could cause the issue?
Thank you so much in advance!

As they said in Understanding ITMS-90809: UIWebView API Deprecation:
Add cordova plugin add cordova-plugin-ionic-webview#latest
Check all of your plugins. Update used (for example InAppBrowser 3.2.0) or remove unused plugins.
Also, use Cordova iOS 5.1.1
The most notable fix in this patch release was to make the prepare
step to wait for the platform add step to finish. This resolved the
bug that was seen when setting the WKWebViewOnly flag before adding
the platform.
ionic cordova platform remove ios
ionic cordova platform add ios#5.1.1
In config.xml add:
<platform name="ios">
<preference name="WKWebViewOnly" value="true" />
<feature name="CDVWKWebViewEngine">
<param name="ios-package" value="CDVWKWebViewEngine" />
</feature>
<preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />
</platform>
More about this you can find in the article How To Use 'WKWebViewOnly'.
The above example uses the cordova-plugin-wkwebview-engine plugin:
Add plugin cordova-plugin-wkwebview-engine, preferably the latest version 1.2.1
Add preference attribute CordovaWebViewEngine to the config.xml
Add feature attribute CDVWKWebViewEngine to the config.xml
Add preference WKWebViewOnly to the config.xml
And last but not least:
ionic cordova prepare ios
I hope this helps. I've followed these steps and didn't have any problems with an update to the App Store.

Check the CordovaLib target -> Build Stettings -> User Defined (very bottom) of your project. There you find WK_WEB_VIEW_ONLY = 0 set this to WK_WEB_VIEW_ONLY = 1 Setting the macro via GCC_PREPROCESSOR_DEFINITIONS does not work. You can also search for WK_WEB_VIEW_ONLY with Xcode and it will display quickly if the Flag is set to 0.
This flag will be changed by Cordova only if the configure.xml contains <preference name="WKWebViewOnly" value="true" /> at the time you create a new ios project. So changing it manually in XCode to 1 in addition to adding the preference makes sense.

With latest update apple removed UIWebView usage so app submitted with this UIWebView will be rejected, they want app to be build using WKWebView for improved security and reliability.
NOTE : If you some how added this plugin "cordova-plugin-wkwebview-engine" and ran "npm i cordova-plugin-wkwebview-engine" kindly undo these steps i.e (Remove plugin and npm uninstall it). As this will fail the build ios step with error 65.
To achieve this in our existing project we need to follow these steps in sequence so that our app gets deployed in App Store.
1). ionic cordova platform remove ios
2). ionic cordova plugin remove cordova-plugin-ionic-webview
3). ionic cordova plugin add cordova-plugin-ionic-webview#latest
4). npm install #ionic-native/ionic-webview#latest
5). Add following XML code in config.xml file under platform ios
// These preferences and feature will automatically replace UIWebView to WKWebView in all the places of code during compile time.
<preference name="WKWebViewOnly" value="true" />
<feature name="CDVWKWebViewEngine">
<param name="ios-package" value="CDVWKWebViewEngine" />
</feature>
<preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />
6). Check in package.json file under dependencies key "cordova-ios": "5.1.1" should exist, if not exist then add "cordova-ios": "5.1.1"
7). ionic cordova platform add ios
8). ionic cordova prepare ios
9). ionic cordova build ios
Now these steps will successfully build the ios App and will be ready for deployment.
NOTE: I tested these steps in ionic 3 and ionic 4.
Hope this will help you or somebody else!
Thanks!

Related

ionic3 Cordova build ios issue with file transfer plugin

I update my Cordova ios to version 6 because of apple email that says ( Deprecated API Usage - existing app that use UIWebView are no longer accepted) ,but after that i keep getting this build error,
The following build commands failed:
CompileC /Users/moesaif/Library/Developer/Xcode/DerivedData/مفسر_أحلامي-epzhtxsuxnuafngaxollgqmkcrww/Build/Intermediates.noindex/مفسر\ أحلامي.build/Debug-iphonesimulator/مفسر\ أحلامي.build/Objects-normal/x86_64/CDVFileTransfer.o /Users/moesaif/Desktop/Dreams/platforms/ios/مفسر\ أحلامي/Plugins/cordova-plugin-file-transfer/CDVFileTransfer.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
ionic Cordova platform ls :
Installed platforms:
android 7.1.4
browser 6.0.0
ios 6.1.1
Available platforms:
electron ^1.0.0
osx ^5.0.0
windows ^7.0.0
any help please..!
Thanks.
You need to update the plugin to latest version. If it still uses UIWebView, then you need to update it manually to support WKWebView.
cordova-plugin-file-transfer is deprecated and seems not working with the ios#6.1.1 .
I still use it with ios#5.1.1 and the flag in config.xml to use WKWebview:
<preference name="WKWebViewOnly" value="true" />
Before sending to apple, search and check in Xcode, that you don't have any mention to UIWebview.
Sometimes a clean platforms is needed or you still have and old InAppBrowser version

Ionic Angular 90809 error when deploying to Apple

I did quite a research on this one, and even though it is a very common issue none of the solutions worked for me so I keep getting the dreaded:
ITMS-90809: Deprecated API Usage - New apps that use UIWebView are no longer accepted. Instead, use WKWebView for improved security and reliability
My configuration is this:
Ionic:
Ionic CLI : 6.10.1 (/usr/local/lib/node_modules/#ionic/cli)
Ionic Framework : ionic-angular 3.9.2
#ionic/app-scripts : 3.2.4
Cordova:
Cordova CLI : 9.0.0 (cordova-lib#9.0.1)
Cordova Platforms : android 8.1.0, ios 4.2.0, windows 4.4.2
Cordova Plugins : cordova-plugin-ionic-webview 5.0.0, (and 13 other plugins)
Utility:
cordova-res : not installed
native-run : not installed
System:
NodeJS : v10.16.2 (/usr/local/bin/node)
npm : 6.14.5
OS : macOS Catalina
Xcode : Xcode 11.5 Build version 11E608c
Plugins:
com.verso.cordova.clipboard 0.1.0 "Clipboard"
cordova-clipboard 1.3.0 "Clipboard"
cordova-plugin-camera 4.1.0 "Camera"
cordova-plugin-crop 0.3.1 "CropPlugin"
cordova-plugin-device 1.1.4 "Device"
cordova-plugin-file 6.0.2 "File"
cordova-plugin-ionic-webview 5.0.0 "cordova-plugin-ionic-webview"
cordova-plugin-splashscreen 4.0.3 "Splashscreen"
cordova-plugin-statusbar 2.4.1 "StatusBar"
cordova-plugin-whitelist 1.3.1 "Whitelist"
cordova-plugin-x-socialsharing 5.6.3 "SocialSharing"
cordova-plugin-x-toast 2.6.0 "Toast"
cordova-sqlite-storage 2.2.0 "Cordova sqlite storage plugin"
es6-promise-plugin 4.2.2 "Promise"
ionic-plugin-keyboard 2.2.1 "Keyboard"
phonegap-plugin-barcodescanner 7.0.2 "BarcodeScanner"
uk.co.workingedge.cordova.plugin.sqliteporter 1.1.1 "sqlite porter"
Could anyone identify something that screams "this one uses UIWebView and you should change it!" ?
UPDATE:
In order to fix the issue I followed these steps:
Made sure that cordova-plugin-ionic-webview was in version >= 5.0.0
Added
<platform name="ios">
<preference name="WKWebViewOnly" value="true" />
...
</platform>
To config.xml
updated ionic npm install -g ionic#latest
updated cordova npm install -g cordova#latest
updated ionic scripts npm install #ionic/app-scripts#latest
Then removed the iOS platform ionic cordova platform rm ios
Re-added the iOS platform ionic cordova platform add ios
and rebuild it ionic cordova prepare ios
I have fixed my app for the exact issue recently and Here are the steps I have followed to fix the issue:
1) Ensure your cordova-plugin-ionic-webview is updated to the latest version 5.0.0. You need to run these two commands to do that.
ionic cordova plugin remove cordova-plugin-ionic-webview
ionic cordova plugin add cordova-plugin-ionic-webview#latest
2) Ensure your cordova-ios is updated to the latest version 6.0.0. Run this command to update it.
npm install cordova-ios#latest --save
3) Check your package.json to see if the versions are updated for both cordova-ios and cordova-plugin-ionic-webview.
4) Ensure you add WKWebViewOnly preference to config.xml file.
<platform name="ios">
<preference name="WKWebViewOnly" value="true" />
...
</platform>
5) This is the most important step. Ensure you remove the ios platform and add it again. Run these commands to remove and add the ios platform.
ionic cordova platform rm ios
ionic cordova platform add ios
Now, when you build the ios app and publish it to the app store, you can see the issue will be fixed.

Cordova iOS ITMS-90809: Deprecated API Usage - New apps that use UIWebView are no longer accepted

Make a simple app with the following:
These are my steps detailed:
cd Desarrollo/Workspace_Xcode/
sudo cordova create MyApp com.mybusiness.app1 ExampleApp
cd MyApp
sudo cordova platform add ios
sudo cordova plugin add cordova-plugin-device
sudo cordova plugin add cordova-plugin-dialogs
sudo cordova plugin add cordova-plugin-inappbrowser
sudo cordova plugin add cordova-plugin-wkwebview-engine
cd ..
sudo chown -R myuser MyApp
Open Xcode workspace, add in config.xml
Added info.plist
Then
sudo cordova platform rm ios
sudo cordova platform add iOS
sudo cordova plugin list
cordova-plugin-device 2.0.3 "Device"
cordova-plugin-dialogs 2.0.2 "Notification"
cordova-plugin-inappbrowser 3.2.0 "InAppBrowser"
cordova-plugin-whitelist 1.3.4 "Whitelist"
cordova-plugin-wkwebview-engine 1.2.1 "Cordova WKWebView Engine"
Run the app, it shows the usual apache device ready, upload to appstore and validate is ok, my app rejected from apple:
ITMS-90809: Deprecated API Usage - New apps that use UIWebView are no longer accepted. Instead, use WKWebView for improved security and reliability. Learn more (https://developer.apple.com....
We have cli version 9.0.0 (cordova-lib#9.0.1)
Cordova 5.1.1
Xcode 11.5
iOS 10.15.5 (catalina)
xcodebuild -showsdks
iOS SDKs:
iOS 13.5 -sdk iphoneos13.5
iOS Simulator SDKs:
Simulator - iOS 13.5 -sdk iphonesimulator13.5
macOS SDKs:
DriverKit 19.0 -sdk driverkit.macosx19.0
macOS 10.15 -sdk macosx10.15
tvOS SDKs:
tvOS 13.4 -sdk appletvos13.4
tvOS Simulator SDKs:
Simulator - tvOS 13.4 -sdk appletvsimulator13.4
watchOS SDKs:
watchOS 6.2 -sdk watchos6.2
watchOS Simulator SDKs:
Simulator - watchOS 6.2 -sdk watchsimulator6.2
The only solutions i found was add plugin from latest cordova-iOS Code that is:
cordova plugin add https://github.com/apache/cordova-plugin-device.git
cordova plugin add https://github.com/apache/cordova-plugin-dialogs.git
cordova plugin add https://github.com/apache/cordova-plugin-inappbrowser.git
cordova platform add https://github.com/apache/cordova-ios.git
This is the only way to remove UIWebView references.
Do not add wkwebengine plugin, because it is not compile with new code.
I had the same issue on Cordova app using cordova ios#5.1.1. I was able to fix using following steps:
Install these plugins along with your other plugins:
"cordova-plugin-inappbrowser": "^4.0.0"
"cordova-plugin-wkwebview-engine": "^1.2.1"
cordova plugin add https://github.com/TheMattRay/cordova-plugin-wkwebviewxhrfix
Remove cordova iOS platform
Add cordova iOS platform 5.1.1
Add this code in config.xml file inside "platform name="ios"> tag
<preference name="WKWebViewOnly" value="true" />
<feature name="CDVWKWebViewEngine">
<param name="ios-package" value="CDVWKWebViewEngine" />
</feature>
<preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />
It will fix the both splash screen stuck issue and apple warning issue.

Ionic 4 build doesn't working on ios 10.3

“I’m using ionic 4 up, and want to support ios 10.3 fully. But unfortunatly build doesn't work on ios 10.3 but it works fine on 12.2”
I was facing the same issue. This issue appears in iOS 10.3 because of splash screen and version of WKwebview plugin.
I did the following steps,
Downgrade cordova-plugin-ionic-webview to 2.3
Change in config.xml
In app.component.ts
setTimeout(() => {
this.splashScreen.hide();
}, 1000);
Steps to make ionic 4 work on ios 10.3, Xcode 10.1
in config.xml target 10.3
<platform name="ios">
<preference name="deployment-target" value="10.3" />
...
replace the cordova-plugin-ionic-webview version to 2.5.3 with the following commands
ionic cordova plugin rm cordova-plugin-ionic-webview
ionic cordova plugin add cordova-plugin-ionic-webview#2.5.3
build the workspapce
ionic cordova prepare ios
in xcode open the workspace file (NOT the .xccodeproj)
projectname.xcworkspace
Make sure that the Deployment Target is set to 10.3
Select the Legacy Build System
File -> Workspace Settings -> Shared Workspace Settings -> Build System -> Legacy Build System
The issue is that they dropped the support for ios 10:
https://forum.ionicframework.com/t/ionic-webview-plugin-version-compatibility/151218/4

Cordova ios platform version too high

I am having problems running the cordova project in the ios emulator. The console.log file does not exist. On Android it is working though. I think it is because of the version of my cordova ios platform, cause when I do:
cordova plugin add cordova-plugin-console
it says:
Plugin doesn't support this project's cordova-ios version. cordova-ios: 4.5.2, failed version requirement: <4.5.0
So my version is too high and does not meet the requirement. What should I do? Should I downgrade it, if yes how can I do that?
Since cordova-ios 4.5.0 cordova-plugin-console is included in the cordova-ios base, you do not need this plugin anymore. You can read about it here.
Check if there is this feature element in the config.xml:
<feature name="Console">
<param name="ios-package" value="CDVLogger"/>
<param name="onload" value="true"/>
</feature>
If not you have to add it as a child of the ios platform tag to use console.log() and other console functions. You can comment it out for production builds.

Resources