Skip to content

Plugin target deployments are out of range, causes Xcode warning #40109

Closed

Description

@jmagman

Plugins can specify their minimum deployment version, but Xcode outputs a warning if this deployment version is less than the range it supports. Random example from #22123:

warning: The iOS deployment target is set to 7.0, but the range of supported deployment target versions for this platform is 8.0 to 12.0. (in target 'Protobuf')
warning: The iOS deployment target is set to 5.0, but the range of supported deployment target versions for this platform is 8.0 to 12.0. (in target 'GoogleToolboxForMac')
warning: The iOS deployment target is set to 4.3, but the range of supported deployment target versions for this platform is 8.0 to 12.0. (in target 'nanopb')
warning: The iOS deployment target is set to 6.0, but the range of supported deployment target versions for this platform is 8.0 to 12.0. (in target 'firebase_analytics')
warning: The iOS deployment target is set to 6.0, but the range of supported deployment target versions for this platform is 8.0 to 12.0. (in target 'firebase_remote_config')
warning: The iOS deployment target is set to 4.3, but the range of supported deployment target versions for this platform is 8.0 to 12.0. (in target 'image_picker')

See efforts like flutter-team-archive/plugins#1483 to keep plugins in the range.

Steps to Reproduce

  1. Add plugin with podspec s.ios.deployment_target < 8.0
  2. Open Xcode and build workspace.

Activity

  1. added
    toolAffects the "flutter" command-line tool. See also t: labels.
    t: xcode"xcodebuild" on iOS and general Xcode project management
    on Sep 9, 2019
  2. jmagman commented on Sep 9, 2019

    @jmagman
    MemberAuthor

    Proposal from #36117 (comment):

    After reading CocoaPods/CocoaPods#7314 I don't really want to imply libraries support a higher version than they claim to, or worse claim they support a higher version, but I also really hate warnings in dependencies you have no power to fix.

    At a minimum, the the 8.0 version in the change doesn't match the version at the top.

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

    And now we're chasing a moving target of whatever Xcode decides is the minimum deploy version.
    What if we did this:

    config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
    

    Then the individual pod targets will inherit IPHONEOS_DEPLOYMENT_TARGET either from the Pods project from that platform :ios call, or inherit from the SDK platform?

    Whatever we do in this Podfile should be duplicated in Podfile-ios-swift and Podfile-macos.

    First attempt:
    #36117 (comment)

    I started with:

    post_install do |installer|
    ...
    {{^withPluginHook}}
          # Inherit the deployment target from the `platform :ios` call above to avoid un-fixable warnings.
          config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
    {{/withPluginHook}}
    

    but it doubles down on the Podfile being a template, which goes against @xster's request for it to become dynamically generated here #9827

    I need to find a mechanism to know if the app is a plugin example app AFTER the project is already generated, which there isn't right now AFAIK.

    And eventual roadblock:
    #36117 (comment)

    Oh yeah, and the other issue is that the Podfile isn't added on create, it's actually added when the first plugin is added. So at that point withPluginHook isn't available, either.

  3. jmagman commented on Jan 24, 2020

    @jmagman
    MemberAuthor

    I changed my mind, ignoring the plugin minimum version is probably a bad idea. Closing.

  4. jmagman commented on Sep 18, 2020

    @jmagman
    MemberAuthor

    New thought: as of #59044 we have a lot more control over this logic, and changes don't require a developer Podfile migration.

    We can parse the minimum versions post-install, and only config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET' if the minimum version is less than the project's version.

    def flutter_additional_ios_build_settings(target)

    See https://www.rubydoc.info/github/CocoaPods/Core/Pod/Podfile

  5. github-actions commented on Aug 12, 2021

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  6. locked as resolved and limited conversation to collaborators on Aug 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    packageflutter/packages repository. See also p: labels.t: xcode"xcodebuild" on iOS and general Xcode project managementtoolAffects the "flutter" command-line tool. See also t: labels.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions