socketio / socket.io-client-swift

Other
5.22k stars 844 forks source link

`Socket.IO-Client-Swift` does not specify a Swift version #1187

Open jefhai opened 5 years ago

jefhai commented 5 years ago

Getting this issue on pod install recently... Did something in recent versions?

Using the following configuration: pod 'Socket.IO-Client-Swift config.build_settings['SWIFT_VERSION'] = '4.2'

Getting:

[!] Unable to determine Swift version for the following pods:

- `Socket.IO-Client-Swift` does not specify a Swift version and none of the targets (...) 
integrating it have the `SWIFT_VERSION` attribute set. 
Please contact the author or set the `SWIFT_VERSION` attribute in at least one of the targets that integrate this pod.
nuclearace commented 5 years ago

What version are you trying to install? All posted versions should have some Swift version set; The current one (v15) has Swift 5.0 set.

mithun-grmtech commented 5 years ago

Also I am facing an issue for Socket.IO-Client-Swift my project SWIFT_VERSION is 4.0

I installed pod for pod 'Socket.IO-Client-Swift', '~> 15.0.0' After installing I am getting the issue at build time

Getting Error: Screen Shot 2019-04-18 at 7 07 27 PM

jefhai commented 5 years ago

@mithun-grmtech try changing your cocoapods versions... I was on 1.6 and down graded to 1.5.3 and it worked for me. Seems like newer cocoapods versions are changing something... I didn't take the time to figure out why though.

mithun-grmtech commented 5 years ago

@jefhai Thanks for the response. My pod version is 1.5.3

jefhai commented 5 years ago

In my pod file I have this pod 'Socket.IO-Client-Swift'. Try that.

I have this in my Pod.lock

  - Socket.IO-Client-Swift (15.0.0):
    - Starscream (~> 3.1)
  - Starscream (3.1.0)

My swift version is 4.2 ... Does going to that cause breaking changes for you?

mithun-grmtech commented 5 years ago

Also I have checked my Podfile.lock

After installing Socket.IO-Client-Swift, my project has not been build

jefhai commented 5 years ago

You said your swift version is 4.0. try 4.2

Here is how I set the swift version:

post_install do |installer|
    installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
            config.build_settings['SWIFT_VERSION'] = '4.2'
        end
    end
end
mithun-grmtech commented 5 years ago

After change my swift version (4.2), I am getting new error: No such module 'CommonCrypto'

again I revert my code

Now: my SWIFT_VERSION: 4.0 And also I am use in pod file:

                    `pod 'Socket.IO-Client-Swift', '~> 13.2.0'`
                    `pod 'Starscream', '<= 3.0.5'`

My problem is fixed. ☺️

nuclearace commented 5 years ago

@mithun-grmtech I did a small test with a Swift 4.2 project that was basically just:

target 'TestSocketIO' do
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!

  # Pods for TestSocketIO

  pod 'Socket.IO-Client-Swift', '~> 15.0.0'

end

And didn't get any issues.

jefhai commented 5 years ago

@nuclearace thats what I'm seeing as well. Works for me. My issue going forward is an inability to use newer cocoapod versions. atm I'm stuck on 1.5.3 until I figure out whats wrong with 1.6 and the latest Socket IO package.

@mithun-grmtech can you provide your Podfile and Podfile.lock if they dont contain anything sensitive (or just scrub anything sensitive. Glad you go your problem fix.

nuclearace commented 5 years ago

@jefhai Ah okay, I'm using 1.7.0.beta.2

nuclearace commented 5 years ago

You might actually need to use the beta, iirc I was also getting CocoaPods errors until I did.

mithun-grmtech commented 5 years ago

Sorry for delay response!! @nuclearace I changed my swift version 4.2 and included pod 'Socket.IO-Client-Swift', '~> 15.0.0' in podfile. After installing pod I got an error: No such module 'CommonCrypto'

@jefhai my pod version is 1.5.3 my pod file:


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

target 'Happy To You' do
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!

  pod 'Toaster'
  pod 'Socket.IO-Client-Swift', '~> 13.2.0'
  pod 'Starscream', '<= 3.0.5'

end

my Podfile.lock:


PODS:
  - Socket.IO-Client-Swift (13.2.1):
    - Starscream (~> 3.0.2)
  - Starscream (3.0.5)
  - Toaster (2.1.1)

DEPENDENCIES:
  - Socket.IO-Client-Swift (~> 13.2.0)
  - Starscream (<= 3.0.5)
  - Toaster

SPEC REPOS:
  https://github.com/cocoapods/specs.git:
    - Socket.IO-Client-Swift
    - Starscream
    - Toaster

SPEC CHECKSUMS:
  Socket.IO-Client-Swift: b94943e2fb916fe2f95244b9ed21828634002280
  Starscream: faf918b2f2eff7d5dd21180646bf015a669673bd
  Toaster: a6c9532de1ded8105e77376f7dffeb2e12b46dbb

PODFILE CHECKSUM: 65e629......................................

COCOAPODS: 1.5.3
DoctorWiseman commented 5 years ago

i have this issue too, when I lower my pod version to 1.5.3. the issue been sovle

Dimius555 commented 5 years ago

you just have topod update and that's it I had the same after updating Xcode to 10.2

jefhai commented 5 years ago

@Dimius555 unfortunately that doesn't work for me

Dimius555 commented 5 years ago

@jefhai look at build info, which version of socket pod's is there?

jefhai commented 5 years ago

@Dimius555 look at the above posts

Dimius555 commented 5 years ago

@jefhai cmd+shift+k?