Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not compile for any target because of unavailable SFSafariViewController #146

Closed
kisileno opened this issue Sep 30, 2017 · 4 comments
Closed
Assignees
Labels

Comments

@kisileno
Copy link

On macOS 10.13.1 Beta
Xcode 9.0 (9A235)
AppAuth 0.9.1
Project does not compile because of 'SFSafariViewController' is only available on iOS 9.0 or newer

Changing target from iOS 9 to 10, or 11 does nothing.
Most probably the problem is in Xcode, but anyway, any hints how to fix this?
screen shot 2017-09-30 at 12 57 39 pm

@ened
Copy link

ened commented Oct 3, 2017

Using Cocoapods?

Based on this SO post: https://stackoverflow.com/a/37289688/375209

Add to the end of your Podfile:

post_install do |installer|
    installer.pods_project.targets.each do |target|
        if "#{target}" == "AppAuth"
            target.build_configurations.each do |config|
                config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.3'
            end
        end
    end
end

:-}

@kisileno
Copy link
Author

kisileno commented Oct 3, 2017

@ened Thank you!
That fixed the problem. Now my app is compiling and running fine.
But I am a bit concerned about 'IPHONEOS_DEPLOYMENT_TARGET'. Is it a right approach to set target iOS?

Btw all this time I had this in my Podfile:

target 'my app' do
  platform :ios, '10.0'
  pod 'GTMAppAuth'
...

but seems like pods are special and require additional configuration.

@ened
Copy link

ened commented Oct 4, 2017

Either this projects platform dependency should be updated in the podspec or the code should be adapted to support both the old and new method (SFSafari.. being the new one). The method above does the first thing, but limited to your project.

Probably good idea to send a PR here and fix it permanently.

@WilliamDenniss
Copy link
Member

So this was a case of a newly introduced warning breaking downstream builds due to our "treat warnings as errors" flag. The code in this case was still functionally correct, but not in a way that would avoid the warning.

Changing the deployment target to 9 is a valid workaround as long as you don't need to target iOS 7 or 8 (which AppAuth still supports). Another workaround is adding silent_warnings! to your Podfile to suppress warnings from all Pods.

#158 resolves the underlying warning, and also moves "treat warnings as errors" from the Podspec to the CI spec. This way warnings will still be flagged during CI, but will avoid breaking downstream builds.

shankari added a commit to shankari/cordova-jwt-auth that referenced this issue Jan 18, 2018
Issue openid/AppAuth-iOS#146
Fix openid/AppAuth-iOS#158
Release in https://github.com/openid/AppAuth-iOS/releases/tag/0.91.0

> Fixes several "availability" warnings and errors. Corrects deployment targets.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants