Error updating Flutter project: CocoaPods could not find compatible versions for pod "webview_flutter_wkwebview"

130 Views Asked by At

When attempting to update my Flutter project to a new Flutter version, I encountered the following error related to CocoaPods and the webview_flutter_wkwebview plugin:

[!] CocoaPods could not find compatible versions for pod "webview_flutter_wkwebview":
  In Podfile:
    webview_flutter_wkwebview (from `.symlinks/plugins/webview_flutter_wkwebview/ios`)

Specs satisfying the `webview_flutter_wkwebview (from `.symlinks/plugins/webview_flutter_wkwebview/ios`)` dependency were found, but they required a higher minimum deployment target.
1

There are 1 best solutions below

0
Faiz Ahmad Dae On BEST ANSWER

I managed to solve this issue by adjusting the minimum deployment target in the Podfile.

The webview_flutter_wkwebview pod required a higher iOS deployment target than was previously set. Here are the steps I followed to resolve the error:

  1. Open the iOS Podfile: Navigate to the ios folder of your Flutter project and open the Podfile in a text editor.
  2. Update the iOS Deployment Target: Change the line platform :ios, '9.0' (or whatever your current version is) to platform :ios, '12.0'. This sets the minimum deployment target to iOS 12.0, which is compatible with the webview_flutter_wkwebview requirements.
  3. Save the Podfile: After making the adjustment, save your changes to the Podfile.
  4. Run pod install: Open a terminal, navigate to the ios directory of your project, and execute pod install to update the CocoaPods dependencies with your new settings.
  5. Clean and Rebuild Your Project: It's a good practice to clean your project and rebuild it. Execute flutter clean followed by flutter build ios in your project's root directory.