Skip to content

Conversation

@lookfirst
Copy link

@lookfirst lookfirst commented Jul 13, 2019

Description

Prevents this warning in xcode during build:

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.2.99. (in target 'Flutter')

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I signed the [CLA]
  • I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement].
  • I updated/added relevant documentation (doc comments with ///).
  • All existing and new tests are passing.
  • The analyzer (flutter analyze --flutter-repo) does not report any problems on my PR.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Does your PR require Flutter developers to manually update their apps to accommodate your change?

  • Yes, this is a breaking change (Please read [Handling breaking changes]). Replace this with a link to the e-mail where you asked for input on this proposed change.
  • No, this is not a breaking change.

Prevents this warning in xcode during build:

`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.2.99. (in target 'Flutter')`
@fluttergithubbot fluttergithubbot added the tool Affects the "flutter" command-line tool. See also t: labels. label Jul 13, 2019
@jonahwilliams
Copy link
Contributor

cc @jmagman

@jmagman jmagman self-requested a review July 25, 2019 17:58
Copy link
Member

@jmagman jmagman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we want to force pods to 8.0 if the pod doesn't support it, or even worse force it down if it only supports a later version.
How about we add :inhibit_warnings to the pod install? I'm all for not clogging up my pristine project no-warning with deprecation warnings, etc from dependencies.

pod 'Flutter', :path => engine_dir, :inhibit_warnings => true
pod 'Flutter', :path => File.join(symlink, File.basename(p[:path])), :inhibit_warnings => true

And if you could add it to the following places to keep it all consistent that would be really helpful!

packages/flutter_tools/templates/cocoapods/Podfile-ios-swift:    pod p[:name], :path => File.join(symlink, 'ios')
packages/flutter_tools/templates/cocoapods/Podfile-ios-objc:    pod p[:name], :path => File.join(symlink, 'ios')
packages/flutter_tools/templates/cocoapods/Podfile-macos:      pod p[:name], :path => File.join(symlink, 'macos')

@lookfirst
Copy link
Author

I don't think we want to force pods to 8.0 if the pod doesn't support it

The error message is saying that the range of supported deployment target versions for this platform is 8.0, so you kind of have to force it to 8, no?

@jmagman
Copy link
Member

jmagman commented Jul 25, 2019

How about we add :inhibit_warnings to the pod install?

Actually, I just tried this and it doesn't suppress that warning.

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.

@jmagman jmagman added t: xcode "xcodebuild" on iOS and general Xcode project management platform-ios iOS applications specifically labels Jul 25, 2019
@jmagman
Copy link
Member

jmagman commented Jul 29, 2019

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.

@lookfirst What do you think about this proposal?

@LinusU
Copy link

LinusU commented Jul 29, 2019

I think that this value needs to be controlled by the end user, forcing it to 8.0 would not be good. It would break our project which uses API:s only available on iOS 12.0 and later.

I've posted about this before, here are some relevant threads:

#32791 (comment)
CocoaPods/CocoaPods#4859 (comment)
CocoaPods/CocoaPods#7314 (comment)

@jmagman
Copy link
Member

jmagman commented Jul 29, 2019

I think that this value needs to be controlled by the end user, forcing it to 8.0 would not be good. It would break our project which uses API:s only available on iOS 12.0 and later.

@LinusU Would it work for your use-case if the pods did not have a deployment version, but instead inherited the value from the platform :ios specified in your Podfile?

Screen Shot 2019-07-29 at 2 31 32 PM

with platform :ios, '12.0' becomes
Screen Shot 2019-07-29 at 2 31 41 PM

@lookfirst
Copy link
Author

I just discovered that https://github.com/flutter/plugins/tree/master/packages/google_sign_in requires 9.0 (there was warnings in Xcode when I included it), so now I'm past 8 anyway.

@lookfirst
Copy link
Author

In order to move from 8 to 9, I had to edit the Podfile as well as the xcode project. It was a pain. If you can simplify it so that I just edit the Podfile, that would be great.

@LinusU
Copy link

LinusU commented Jul 30, 2019

@jmagman

Would it work for your use-case if the pods did not have a deployment version, but instead inherited the value from the platform :ios specified in your Podfile?

Yes, that would be perfect 👍

@jmagman
Copy link
Member

jmagman commented Jul 30, 2019

In order to move from 8 to 9, I had to edit the Podfile as well as the xcode project. It was a pain. If you can simplify it so that I just edit the Podfile, that would be great.

@lookfirst Would you like me to take this over then?

@christopherfujino
Copy link
Contributor

@jmagman Are you going to fix this in a separate PR?

@jmagman
Copy link
Member

jmagman commented Aug 8, 2019

@jmagman Are you going to fix this in a separate PR?

I was going to just take this one over.

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.

@jmagman
Copy link
Member

jmagman commented Aug 8, 2019

@jmagman Are you going to fix this in a separate PR?

I was going to just take this one over.

Actually it looks like there's no way to transfer a PR to another fork. I will make a new one.

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 guess that issue has been open awhile though and the Podfile are already templates, so we can add it to the list of behaviors that needs to be migrated if it ever becomes generated on flutter builds.

@jmagman
Copy link
Member

jmagman commented Aug 8, 2019

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.

@xster
Copy link
Member

xster commented Aug 10, 2019

#9827 indeed probably needs a re-summary at the bottom. Based the issues I originally wanted us to fix, likely 75% of it is already done.

@jmagman jmagman mentioned this pull request Aug 27, 2019
9 tasks
@zanderso zanderso added the p: tooling Affects the flutter_plugin_tools package label Aug 29, 2019
@zanderso
Copy link
Member

zanderso commented Sep 5, 2019

@jmagman What is the status of this PR? Can in be closed?

@jmagman
Copy link
Member

jmagman commented Sep 9, 2019

I documented the issue and proposed solutions in #40109. Closing this PR.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 4, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

p: tooling Affects the flutter_plugin_tools package platform-ios iOS applications specifically t: xcode "xcodebuild" on iOS and general Xcode project management tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants