Gravid Banner

Updating CocoaPods to run Flutter Apps on iOS

Having successfully run a couple of Flutter Apps on Android devices and the iOS Simulator (from AndroidStudio), I was not expecting there to be much of a problem getting my App running on iOS. Unfortunately as soon as I tried to run my code from XCode I hit an error

module "google mobile ads" not found

A quick search revealed a large number of possible solutions most of them either not obviously relevant or not applicable to Flutter. Looking into the XCode error I found that it was located in a generated source file

GeneratedPluginRestraint.m

Another search for a more general error led me to this StackOverflow which suggested that the issue was in the Podfile.

Following the instructions I got the following:

> cd ios
> flutter clean
> flutter pub get
[... various successful package installs here ..]
> pod init
[!] Existing Podfile found in directory
> pod instal
Analyzing dependencies
[!] CocoaPods could not find compatible versions for pod "Flutter":
  In Podfile:
    Flutter (from `Flutter`)

This next error led me to another StackOverflow which instructed me to uncomment and update the second line of the Podfile as follows

# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'
platform :ios, '14.0'

‘Making this update, re-running pod instal and rebuilding the app got the app working on iOS.


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *