UIWebView referenced in Xamarin.iOS project

Blake Nong 1 Reputation point
2021-03-17T14:23:17.14+00:00

Hi all,

I'm trying to publish my app to App Store and I got the rejection Apple about the deprecation of UIWebView. I cleaned up all the UIWebView reference in my code but looks like there are some nuget libs are still referencing to UIWebView as following.

FBLPromises
GTMSessionFetcher
GoogleAPIClientForREST
GoogleToolboxForMac
GoogleUtilities
Protobuf
leveldb
libSkiaSharp
nanopb

Could you please help how to resolve these issues?

Thanks & best regards,

Developer technologies | .NET | Xamarin
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Cole Xia (Shanghai Wicresoft Co,.Ltd.) 6,756 Reputation points
    2021-03-19T02:30:33.52+00:00

    Hello,

    Welcome to Microsoft Q&A!

    • The best solution : Start by updating your external dependencies to their latest versions since this situation might already be solved in a newer release. If not, contact the maintainer(s) of the libraries and ask about their update plans , or replace the libraries totally.
      • Alternatively , if you're using Xamarin.Forms , enable the managed linker (on the whole project or, at least, on the dependency using UIWebView) so it might be removed, if not referenced. That will solve the problem but might required additional work to make your code linker-safe.
      • A forceful solution is to add --optimize=force-rejected-types-removal to your project's Additional mtouch arguments. This will remove traces of UIWebView from the application. However, any code that refers to the type will not work properly (expect exceptions or crashes).

    Refer to docs : https://learn.microsoft.com/en-us/xamarin/ios/user-interface/controls/webview#removal.


    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.