Skip to content

Provide better error message when a plugin requires a min iOS version higher than the app #113762

Closed
@stuartmorgan-g

Description

@stuartmorgan-g

Currently the experience of trying to use a plugin that has a higher minimum iOS version than the app's minimum iOS version is really verbose, and not very easy for someone without CocoaPods experience to understand. For instance, here's the output of trying to build the google_maps_flutter example after changing the plugin to require iOS 12, but not updating the example:

[...]
Running pod install...                                             493ms
CocoaPods' output:
↳
      Preparing

    Analyzing dependencies

    Inspecting targets to integrate
      Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``)
      Using `ARCHS` setting to build architectures of target `Pods-RunnerTests`: (``)
      Using `ARCHS` setting to build architectures of target `Pods-RunnerUITests`: (``)

    Finding Podfile changes
      A google_maps_flutter_ios
      R google_maps_flutter
      - Flutter
      - OCMock
      - integration_test

    Fetching external sources
    -> Fetching podspec for `Flutter` from `Flutter`
    -> Fetching podspec for `google_maps_flutter_ios` from `.symlinks/plugins/google_maps_flutter_ios/ios`
    -> Fetching podspec for `integration_test` from `.symlinks/plugins/integration_test/ios`

    Resolving dependencies of `Podfile`
      CDN: trunk Relative path: CocoaPods-version.yml exists! Returning local because checking is only performed in
      repo update
      CDN: trunk Relative path: all_pods_versions_c_0_6.txt exists! Returning local because checking is only
      performed in repo update
      CDN: trunk Relative path: Specs/c/0/6/OCMock/3.9.1/OCMock.podspec.json exists! Returning local because
      checking is only performed in repo update
    [!] CocoaPods could not find compatible versions for pod "google_maps_flutter_ios":
      In Podfile:
        google_maps_flutter_ios (from `.symlinks/plugins/google_maps_flutter_ios/ios`)

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

    /Library/Ruby/Gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:317:in `raise_error_unless_state'
    /Library/Ruby/Gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:299:in `block in unwind_for_conflict'
    /Library/Ruby/Gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:297:in `tap'
    /Library/Ruby/Gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:297:in `unwind_for_conflict'
    /Library/Ruby/Gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:682:in `attempt_to_activate'
    /Library/Ruby/Gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:254:in `process_topmost_state'
    /Library/Ruby/Gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:182:in `resolve'
    /Library/Ruby/Gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/resolver.rb:43:in `resolve'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/resolver.rb:94:in `resolve'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:1078:in `block in
    resolve_dependencies'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/user_interface.rb:64:in `section'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:1076:in
    `resolve_dependencies'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:124:in `analyze'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:416:in `analyze'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:241:in `block in
    resolve_dependencies'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/user_interface.rb:64:in `section'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:240:in `resolve_dependencies'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:161:in `install!'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/command/install.rb:52:in `run'
    /Library/Ruby/Gems/2.6.0/gems/claide-1.1.0/lib/claide/command.rb:334:in `run'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/command.rb:52:in `run'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/bin/pod:55:in `<top (required)>'
    /usr/local/bin/pod:23:in `load'
    /usr/local/bin/pod:23:in `<main>'

Error output from CocoaPods:
↳

    [!] Automatically assigning platform `iOS` with version `11.0` on target `Runner` because no platform was
    specified. Please specify a platform for this target in your Podfile. See
    `https://guides.cocoapods.org/syntax/podfile.html#platform`.

Error running pod install

It's particularly misleading because the "Error output from CocoaPods" section isn't actually the problem. Adding an explicit minimum version to the example's Podfile will make that part go away, but won't change anything else.

The actual error is right in the middle of that wall of text:

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

Not only is that line not as easy to find as we'd like, but it's not clearly actionable. It doesn't say what the plugin minimum is, what the app minimum is, or what to do next (update the app's minimum deployment target, for which that missing info would be very useful, or remove the plugin).

We should consider parsing the output and providing our own error message instead for this case.

Metadata

Metadata

Labels

P2Important issues not at the top of the work lista: buildBuilding flutter applications with the toola: pluginsSupport for writing, building, and running plugin packagesplatform-iosiOS applications specificallyteam-iosOwned by iOS platform teamtoolAffects the "flutter" command-line tool. See also t: labels.triaged-iosTriaged by iOS platform team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions