Compiling for iOS 11.0, but module 'Starscream' has a minimum deployment target of iOS 12.0
Hi, We are facing an issue while updating our dependency on cocoapods.
- ERROR | [iOS] xcodebuild: Socket.IO-Client-Swift/Source/SocketIO/Engine/SocketEngine.swift:27:8: error: compiling for iOS 11.0, but module 'Starscream' has a minimum deployment target of iOS 12.0
Starscream's dependency in Socket.IO-Client-Swift.podspec is declared as s.dependency "Starscream", "~> 4.0.6". So it is using at least 4.0.6 or the latest available patch (that is what ~> means ). This means that it is using Starscream 4.0.8 (instead of 4.0.6) since two weeks ago. If you check the Starscream.podspec the s.ios.deployment_target went from 11 to 12 on these two patches. That is causing your error.
The error means that Starscream has a higher minimum deployment target higher than Socket.IO-Client-Swift. There are two solutions that worked for me, change the Starscream's Minimum deployment to 11 manually in Pods/Target/Starscream/General/Minimum deployment.
You have to write it, there is no 11 in the options.
Or the solution that worked for me was to specify in my project's Podfile the Starscream version that I want the project to use is exactly 4.0.6
pod 'Starscream', '4.0.6'
Since I am using Cordova I had to change my plugin's plugin.xml so it change the Podfile when the plugin is added.
<pod name="Socket.IO-Client-Swift" spec="16.1.0"/> <pod name="Starscream" spec="4.0.6"/>
You can always use something "more aggressive" like this https://stackoverflow.com/questions/77167628/xcode-stuck-at-compiling-ios-ver-11-while-i-am-using-14-as-a-target
In Xcode, click "Pods.xcodeproj", find "iOS Deployment Target" in Build Settings tag, and update the value to your target.