Search code examples
iosfluttercocoapods

Flutter - update pod dependency loop


I do not know what commands to use to get out of this situation where I seem to have a pod dependency loop that prohibits me to update pod versions? How can I clean the whole project and update or are there any commands beside flutter pub upgrade and flutter pub upgrade --major-versions ?

Per the Flutter GoogleMaps project I should get to v9.0.0 at least or newer

I tried bumping ios version to 15 in the podfile as some sources suggest bc 9.0.0 is for 15 upwards only, but I am still stuck with my original package version. I am looking how to upgrade the package version...

$ flutter pub outdated
Changing current working directory to: /Users/YOU/Documents/app
Showing outdated packages.
[*] indicates versions that are not the latest available.

Package Name                  Current  Upgradable  Resolvable  Latest  

direct dependencies: all up-to-date.

dev_dependencies: all up-to-date.

transitive dependencies:     
async                         *2.11.0  *2.11.0     *2.11.0     2.12.0  
characters                    *1.3.0   *1.3.0      *1.3.0      1.3.1   
collection                    *1.18.0  *1.18.0     *1.18.0     1.19.0  
http_parser                   *4.0.2   *4.0.2      *4.0.2      4.1.0   
material_color_utilities      *0.11.1  *0.11.1     *0.11.1     0.12.0  
meta                          *1.15.0  *1.15.0     *1.15.0     1.16.0  
string_scanner                *1.2.0   *1.2.0      *1.2.0      1.3.0   
webview_flutter               *4.9.0   *4.9.0      *4.9.0      4.10.0  
webview_flutter_android       *3.16.9  *3.16.9     *3.16.9     4.0.0   

transitive dev_dependencies: 
leak_tracker                  *10.0.5  *10.0.5     *10.0.5     10.0.7  
leak_tracker_flutter_testing  *3.0.5   *3.0.5      *3.0.5      3.0.8   
lints                         *5.0.0   *5.0.0      *5.0.0      5.1.0   
stack_trace                   *1.11.1  *1.11.1     *1.11.1     1.12.0  
test_api                      *0.7.2   *0.7.2      *0.7.2      0.7.3   
vm_service                    *14.2.5  *14.2.5     *14.2.5     14.3.0  
all dependencies are up-to-date.

$ pod install
Analyzing dependencies
[!] CocoaPods could not find compatible versions for pod "GoogleMaps":
  In snapshot (Podfile.lock):
    GoogleMaps (< 8.0, = 7.4.0)

  In Podfile:
    google_maps_flutter_ios (from `.symlinks/plugins/google_maps_flutter_ios/ios`) was resolved to 0.0.1, which depends on
      GoogleMaps (< 10.0, >= 8.4)


You have either:
 * out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
 * changed the constraints of dependency `GoogleMaps` inside your development pod `google_maps_flutter_ios`.
   You should run `pod update GoogleMaps` to apply changes you've made.

With the next commands the loop starts

$pod update GoogleMaps
Updating local specs repositories
Analyzing dependencies
[!] CocoaPods could not find compatible versions for pod "Google-Mobile-Ads-SDK":
  In snapshot (Podfile.lock):
    Google-Mobile-Ads-SDK (= 10.11.0, ~> 10.11.0)

  In Podfile:
    google_mobile_ads (from `.symlinks/plugins/google_mobile_ads/ios`) was resolved to 5.2.0, which depends on
      Google-Mobile-Ads-SDK (~> 11.10.0)


You have either:
 * changed the constraints of dependency `Google-Mobile-Ads-SDK` inside your development pod `google_mobile_ads`.
   You should run `pod update Google-Mobile-Ads-SDK` to apply changes you've made.

AND

$pod update Google-Mobile-Ads-SDK
Updating local specs repositories
Analyzing dependencies
[!] CocoaPods could not find compatible versions for pod "GoogleMaps":
  In snapshot (Podfile.lock):
    GoogleMaps (< 8.0, = 7.4.0)

  In Podfile:
    google_maps_flutter_ios (from `.symlinks/plugins/google_maps_flutter_ios/ios`) was resolved to 0.0.1, which depends on
      GoogleMaps (< 10.0, >= 8.4)


You have either:
 * changed the constraints of dependency `GoogleMaps` inside your development pod `google_maps_flutter_ios`.
   You should run `pod update GoogleMaps` to apply changes you've made.

Solution

  • This was the command that solved it

    flutter clean
    rm ios/Podfile.lock 
    flutter pub get 
    cd ios 
    pod install --repo-update