Starscream: Unable to compile on XCode12

Created on 3 Jul 2020  路  8Comments  路  Source: daltoniam/Starscream

Screenshot here

Starscream (4.0.3)
XCode12

Unable to compile.

FoundationHTTPServerHandler.swift

//Type of expression is ambiguous without more context for method != getVerb {

if let method = CFHTTPMessageCopyRequestMethod(response)?.takeRetainedValue() {
            if method != getVerb { 
                delegate?.didReceive(event: .failure(HTTPUpgradeError.invalidData))
                return true
            }
        }

Most helpful comment

Try replacing:
method != getVerb
with
self.getVerb.isEqual(to: method as String)

This worked for me!

All 8 comments

Try replacing:
method != getVerb
with
self.getVerb.isEqual(to: method as String)

This worked for me!

There is a PR by @amayers fixing this issue here.

I've created a fork with the fix since the PR is not merged yet. If you are using cocoapods, then try:
pod 'Starscream', :git => 'https://github.com/ethancwb/Starscream.git', :branch => 'xcode-12-hotfix'
However, I highly suggest you to only apply the change on an experimental branch, not on your master. This is only a temporary workaround.

@ethancwb you didn't need to create a new fork to get the fix. You could have just pointed your pod at the repo/branch that my #799 is on.

@amayers Thanks for the response. Actually, after searching, I found that I just need to update the deploy target to above iOS 11.0. Then this issue is gone.

I am testing my app with new SwiftUI, Swift Package Manager and Xcode 12 Beta and have same issue, please fix it!

I am testing my app with new SwiftUI, Swift Package Manager and Xcode 12 Beta and have same issue, please fix it!

@22Round the fix has been merged to master, but a new version hasn't been released. So you could just point SPM to use master instead of a fixed version number, and everything should work.

4.0.4 released!

Was this page helpful?
0 / 5 - 0 ratings