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

Use Legacy Swift Language Version” (SWIFT_VERSION) is required to be configured correctly for targets which use Swift. #63

Closed
Mozoee opened this issue Jan 5, 2017 · 15 comments

Comments

@Mozoee
Copy link

Mozoee commented Jan 5, 2017

I tried to install it through cocoapod. Installation went successful but my xcode force me to convert swift code i tried doing it later i got 18 errors. Then i deintegrate it pod from my project and again tried installing it. However, process was successful again but this time i didnt choose conversion of swift syntax on which i got this error: " Check dependecies: Use Legacy Swift Language Version” (SWIFT_VERSION) is required to be configured correctly for targets which use Swift. Use the [Edit > Convert > To Current Swift Syntax…] menu to choose a Swift version or use the Build Settings editor to configure the build setting directly." What should i do next ?

@dennisweissmann
Copy link
Collaborator

Hi, that's unfortunate :( Which version of Swift are you using in your project? Which version of the framework do you use? How does your podfile look like?

@Mozoee
Copy link
Author

Mozoee commented Jan 5, 2017

Hi, My Swift version is 3.0.2. I am sorry about the Pod file as i have again deintegrate it and now working through my own class.

@dennisweissmann
Copy link
Collaborator

Okay, I'll close this for now. Thanks for reporting!

@chlebta
Copy link

chlebta commented Jan 19, 2017

@dennisweissmann got same issue if I delete : SWIFT_VERSION then I've this convert to swift 3 issue

@dennisweissmann
Copy link
Collaborator

@chlebta damn, which version are you using? (DeviceKit and Xcode and what is your application language version?)

@danielewin
Copy link

platform :ios, '10.0'

target '...' do

use_frameworks!

pod '...'

post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '3.0'
end
end
end

end

@dennisweissmann
Copy link
Collaborator

Hi @danielewin,

I cannot reproduce this :(

What I've tried:

  1. Create a single-view iOS Application called "DeviceKitDemo".

  2. cd to that folder, pod init

  3. Replace contents of file with

    platform :ios, '10.0'
    target 'DeviceKitDemo' do
    use_frameworks!
    pod 'DeviceKit', '~> 1.0'
    post_install do |installer|
    end
    end
    end
    end

    I've also tried your version

    platform :ios, '10.0'
    target 'DeviceKitDemo' do
    use_frameworks!
    pod 'DeviceKit', '~> 1.0'
    post_install do |installer|
    installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
    config.build_settings['SWIFT_VERSION'] = '3.0'
    end
    end
    end
    end

  4. pod install

  5. Open the .workspace

@vixentael
Copy link

vixentael commented Feb 1, 2017

Hi guys!

I experience the same problem using xcode 8.2.1 swift 3.0.2.

I reproduce it with versions 1.0.0 and 1.0.1 of DeviceKit

screen shot 2017-02-01 at 2 48 16 pm

@vixentael
Copy link

Probably I know the reason.

My podfile also contains the line config.build_settings['SWIFT_VERSION'] = '3.0'.

I removed it, deintegrate Pods, init them, clean up Derived Data, re-opened Xcode (those xcode magic tricks) --> and have no errors now ¯_(ツ)_/¯

@dennisweissmann
Copy link
Collaborator

Hey @vixentael ,

Glad you solved it, however I still cannot reproduce it :( As you can see in my previous reply I also tried it with a pod file which explicitly sets the Swift version.

However, I'll leave this issue open so that people can find it easier (and work around it).

Thanks for your input and workaround!

@chlebta
Copy link

chlebta commented Feb 2, 2017 via email

@dennisweissmann
Copy link
Collaborator

@vixentael I only now saw your screenshot, this is not related to this issue, these are errors coming from SwiftLint, you should always exclude 3rd-party code from linting!

@dennisweissmann
Copy link
Collaborator

Okay guys, which version of CocoaPods do you use? I'm on 1.2.0 and I still cannot reproduce it (also not with Cocoa Lumberjack @chlebta)

@chlebta
Copy link

chlebta commented Feb 6, 2017

@dennisweissmann I'm using pod 1.1.1

@dennisweissmann
Copy link
Collaborator

Is this still an issue with Xcode > 8.3?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants