From April 2020, Apple announced new apps using the depreciated UIWebView will be rejected (for existing apps already in app store, the deadline is December 2020). Fortunately for xamarin apps, this is quite simple. All that is needed is to add a flag to xamarin.iOS release configuration as described below
Right-click on your xamarin.ios project, select properties in Visual studio windows (or options for visual studio Mac) and choose ios Build and update the following parameters:
- Select Release|iPhone configuration
- For linker behaviour, select either Link Framework SDKs only or link All
- Add this flag “
--optimize=experimental-xforms-product-type” under additional mtouch arguments
|Visual Studio Mac||Visual studio Windows|
Save your changes and to ensure everything is as it’s suppose to be, check the .csproj file and you should have something similar to this.
If you are lucky, that is all that is needed to remove this warning. If the issue still persists, read on.
However, if this is not the case, the next place to look will be in the Nuget packages. This can be a painful process especially if you have a lot of Nuget packages. The first step to ensure you have updated your Nuget packages to the latest versions. If the issue still persists, its time to further dig into you Nuget packages to find the culprit. In time of writing this, one common nuget that still uses UIWebView is Xamarin.iOS.MaterialComponents which can be found in found in below nugets as well:
To fix this issue,
- Uninstall Xamarin.Forms.Visual.Material or Xamarin.Visual.Material.Design
- Add latest version of Xamarin.iOS.MaterialComponents
- Re-install Xamarin.Forms.Visual.Material or Xamarin.Visual.Material.Design
- Delete your bin/obj folders, clean and rebuild, then try again.
If the warning still persists, go through your Nuget packages analyzing them further or see this post.