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

SessionDelegate naming conflict between Kingfisher and Alamofire in Xcode 12 GM #1517

Closed
3 tasks done
gobtronic opened this issue Sep 17, 2020 · 14 comments
Closed
3 tasks done

Comments

@gobtronic
Copy link

gobtronic commented Sep 17, 2020

Check List

Issue Description

What

There seems to be a naming conflict inside the objc header file with the SessionDelegate class when using both Kingfisher and Alamofire in Xcode 12 GM. (You can see the issue on Alamofire side here, more discussion here)

/Users/sachajln/ios-workspace/MyProject/Carthage/Build/iOS/Kingfisher.framework/Headers/Kingfisher-Swift.h:836:1: error: 'SessionDelegate' has different definitions in different modules; first difference is definition in module 'Kingfisher.Swift' found method with designater initializer
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
^
/Users/sachajln/ios-workspace/MyProject/Carthage/Build/iOS/Alamofire.framework/Headers/Alamofire-Swift.h:772:1: note: but in 'Alamofire.Swift' found method with no designater initializer
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
^

Reproduce

Use Alamofire and Kingfisher frameworks inside a project and do a xcodebuild -project YOUR_PROJECT.xcodeproj -sdk iphoneos with Xcode 12 GM command line tools.

Comments

I'm using Carthage to build and copy the frameworks in my project

@timbms
Copy link

timbms commented Sep 18, 2020

I am having exactly the same problem with latest Xcode official release

@Senocico
Copy link

Senocico commented Sep 18, 2020

The same issue.
For now, a quick solution is to install the module with CocoaPods (if you're using Carthage) and if needed, rename the SessionDelegate interface.

@alperkayabasi
Copy link

Issue still exists in Xcode 12 official release.

The only solution for now is to rename the "SessionDelegate" to "KFSessionDelegate" or something like that in Kingfisher module.

@onevcat
Copy link
Owner

onevcat commented Sep 19, 2020

I'll check what I can do for it.

@onevcat
Copy link
Owner

onevcat commented Sep 19, 2020

@sachajln @timbms @Senocico @alperkayabasi

Can you confirm whether this branch "fix/no-objc" can solve your issue? If everything goes fine, I will merge it and tag a new version soon.

Thanks!

@vvit
Copy link

vvit commented Sep 20, 2020

@onevcat Worked for me! Thanks.

@alperkayabasi
Copy link

@onevcat Worked for me too, thank you.

@onevcat
Copy link
Owner

onevcat commented Sep 20, 2020

5.15.3 was released for this.

@onevcat onevcat closed this as completed Sep 20, 2020
@KhairulRijl
Copy link

hello @onevcat, i tried from cocoapod for version 5.15.3 has same problem with alamofire

@alperkayabasi
Copy link

@KhairulRijl Which Alamofire version do you have in podfile? It worked for me with the latest release 5.2.2.

@KhairulRijl
Copy link

@alperkayabasi now i'm using 4.9.0 version of alamofire for some reason, is there any problem with version 4 alamofire with kingfisher?

@alperkayabasi
Copy link

@KhairulRijl My guess is Alamofire removed objc module support with version 5. So the problem still exists if you use v4.

@timbms
Copy link

timbms commented Sep 21, 2020

5.15.3 was released for this.

@onevcat is 5.15.3 already available via cocoapods?

@KhairulRijl
Copy link

KhairulRijl commented Sep 22, 2020

@alperkayabasi yes, the problem from v4 alamofire. after config build setting in cocoapods spesific for alamofire, change to No for objc module support, the problem is gone. thanks for your information.

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

7 participants