Apple Deprecated UIWebView: Build Failure on App Upload and Solutions

Apple no longer accepts new apps containing the UIWebView API, only WKWebView is allowed.
If you receive an email like the one below during app upload, it means your app build failed due to UIWebView references, and you must fix the issue before resubmitting.

New Certificate


Step 1: Replace UIWebView Globally

  1. Search the project for all occurrences of UIWebView.
  2. Replace them with WKWebView.

In most cases, this will resolve the issue. After replacement, rebuild and resubmit the app.

If the error persists, it likely means a static library still contains UIWebView, which requires further investigation.

New Certificate


Step 2: Check Static Libraries for UIWebView

  1. Open Terminal and navigate to your project directory.
  2. Run the following command to check for any occurrences of UIWebView in static libraries or files:
1grep -r UIWebView .

This command will list any static libraries or files containing UIWebView references.

New Certificate

Example output:

Binary file ./Source/Common/Libs/PayService/UnionPaySDK/libPaymentControl.a matches

This means the UnionPaySDK’s libPaymentControl.a static library contains UIWebView.


Solution

  • Visit the SDK provider’s documentation and download the latest version of the SDK.
  • Replace the old static library with the updated one.
  • Rebuild and re-upload the app. The build should now pass successfully.