Forum Xamarin.iOS

ITMS-90809: Deprecated API Usage : App rejected due to use of UIWebView

Hi,

I am working on a Xamarin ios project and while submitting the build I receive the following message 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/documentation/uikit/uiwebview).

I have replaced UIWebView with WKWebView in my code but still the same problem.

I have tried the linker suggestion but it doesn't work. Then I found this command grep -rnw . -e 'UIWebView'. When I run this command it displays following result:-

Binary file ./packages/Xamarin.Auth.1.7.0/lib/Xamarin.iOS10/Xamarin.Auth.pdb matches Binary file ./packages/Xamarin.PayPal.iOS.2.18.0/lib/Xamarin.iOS10/Xamarin.PayPal.iOS.dll matches Binary file ./ProjectName/obj/iPhoneSimulator/Debug/device-builds/iphone 11-13.6/mtouch-cache/1-Link/Xamarin.iOS.pdb matches Binary file ./ProjectName/obj/iPhoneSimulator/Debug/device-builds/iphone 11-13.6/mtouch-cache/1-Link/Xamarin.PayPal.iOS.dll matches Binary file ./ProjectName/obj/iPhoneSimulator/Debug/device-builds/iphone 11-13.6/mtouch-cache/1-Link/Xamarin.iOS.dll matches ./ProjectName/obj/iPhoneSimulator/Debug/device-builds/iphone 11-13.6/mtouch-cache/arguments:288: --warn-on-type-ref=UIKit.UIWebView \ Binary file ./ProjectName/obj/iPhoneSimulator/Debug/device-builds/iphone 11-13.6/mtouch-cache/libPayPalMobile.a matches Binary file ./ProjectName/bin/iPhoneSimulator/Debug/Xamarin.Auth.pdb matches Binary file ./ProjectName/bin/iPhoneSimulator/Debug/Xamarin.PayPal.iOS.dll matches Binary file ./ProjectName/bin/iPhoneSimulator/Debug/device-builds/iphone 11-13.6/ProjectName.app/ProjectName matches ./ProjectName/ProjectName.csproj:35: <MtouchExtraArgs>--optimize=force-rejected-types-removal --warn-on-type-ref=UIKit.UIWebView -warnaserror:1503</MtouchExtraArgs> ./ProjectName/ProjectName.csproj:76: <MtouchExtraArgs>--warn-on-type-ref=UIKit.UIWebView</MtouchExtraArgs>

I have updated all the packages to the latest version.

Thanks in Advance.

Best Answer

Answers

  • KushRaghavKushRaghav Member ✭✭
    edited August 2020

    Thanks @YelinZh for an early response.

    I replaced all the UIWebView with WKWebView but still the build was rejected.

    The main culprit were these nugets:-

    Xamarin.Auth Xamarin.PayPal.iOS

    I removed them and updated my code and finally the build got accepted.

    Thanks @YelinZh .

    NOTE ** :- I would like to say for other developers that use **grep -rnw . -e 'UIWebView' inside your project directory. This will list down all the packages and binaries that are using UIWebView. Then follow the following steps:-
    1.) Remove or update the 3rd party nugets that are listed.
    2.) Set the Linking to Link SDK assemblies only or All.
    3.) In the Additional mtouch arguments add this flag --optimize=experimental-xforms-product-type

    If you are still seeing the following in the result of grep command:-
    Binary file ./Clickomen/obj/iPhone/Release/mtouch-cache/1-Link/Xamarin.iOS.pdb matches Binary file ./Clickomen/obj/iPhone/Release/mtouch-cache/1-Link/Xamarin.iOS.dll matches

    Don't worry mtouch arguments will take care of them.

  • KushRaghavKushRaghav Member ✭✭

    Thanks @YelinZh for a quick response.

    I replaced UIWebView with WKWebView in my code. But, by using the command grep -rnw . -e 'UIWebView' I found that the main culprits were the following nugets:-

    Xamarin.Auth and Xamarin.PayPal.iOS

    I removed them and updated the code. Finally the build got accepted. Thanks @YelinZh

    NOTE :- I would like summarize few things for other developers. If you are experiencing the same build rejection then follow these steps:-
    1.) Replace UIWebView with WKWebView in the code.
    2.) Use grep -rnw . -e 'UIWebView' command in your project directory to find the binaries that are referencing UIWebView. Remove or update those.
    3.) In the Additional mtouch arguments add this flag --optimize=experimental-xforms-product-type and set Linker Behavior to SDK Only or Link All.

    Now on running the grep command if you still see these two:-
    Binary file ./ProjectName/obj/iPhone/Release/mtouch-cache/1-Link/Xamarin.iOS.pdb matches Binary file ./ProjectName/obj/iPhone/Release/mtouch-cache/1-Link/Xamarin.iOS.dll matches

    ignore them mtouch arguments will take take care of them.

  • rdelangelhmxrdelangelhmx Member
    edited March 11

    I have the same issue, but with Xamarin Forms 5.0
    I even did two runs with the "grep" to identify the "WebView" and the "UIWebView"
    These are the results:

    This is the content of folder

    I have an open BUG in Xamarin.Forms No. 13977

Sign In or Register to comment.