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

Xcode 12.1 Compiler Error "FormViewController" #2109

Closed
laohanme opened this issue Nov 2, 2020 · 7 comments · Fixed by #2113
Closed

Xcode 12.1 Compiler Error "FormViewController" #2109

laohanme opened this issue Nov 2, 2020 · 7 comments · Fixed by #2113

Comments

@laohanme
Copy link

laohanme commented Nov 2, 2020

image

When submitting issues, please provide the following information to help maintainers to fix the problem faster:

  • Environment: Eureka Pod 5.3.1
@laohanme laohanme changed the title Xcode 12.1 Compiler Error "FromViewController" Xcode 12.1 Compiler Error "FormViewController" Nov 2, 2020
@mats-claassen
Copy link
Member

Do you have another class named FormViewController? I haven't seen that error before but might be related to multiple classes of the same name. In that case you could try to use it as Eureka.FormViewController

@victor-yn
Copy link

victor-yn commented Nov 4, 2020

This is caused by a conflict between Eureka & another lib that also exposes a FormViewController in your project. The ObjC generated headers for both will now enter in conflict in Xcode 12 and the compilation will fail, even if you do not use the FormViewController in question.

See for reference https://developer.apple.com/forums/thread/658012

The fix has to come from the 3rd party, so Eureka.

2 ways to fix this:

  • Do not generate headers for ObjC. SWIFT_INSTALL_OBJC_HEADER = NO
  • Set an explicit prefix for ObjC which will resolve namespacing
@objc(EurekaFormViewController)
open func FormViewController { ... }

The second option is obviously the best option and this is definitely something that every third party libs should do 🙏

@omerozk
Copy link

omerozk commented Nov 5, 2020

I have the same issue in my Project when trying to use Xcode 12! 😢

I'm implementing Eureka and Adyen sdk and both have a class exposed called FormViewController.
This issue also occurred between Kingfisher & Alamofire with the SessionDelegate class (here the issue with solution onevcat/Kingfisher#1530)

I would also recommend the solution of setting explicitly a prefix for ObjC 👍

@jackuzcategui
Copy link

Same exact issue has been plaguing us for a few with both Adyen and Eureka. Is there a fix in the pipeline that isn't a workaround?

@mats-claassen
Copy link
Member

Will address this soon. A possible workaround could be to set SWIFT_INSTALL_OBJC_HEADER = NO for the conflicting pod if you don't use it in ObjC. Haven't tested that though

@mats-claassen
Copy link
Member

@laohanme @victor-yn @omerozk @jackuzcategui Could you test if #2113 works for you?

@victor-yn
Copy link

@mats-claassen Thanks for the PR! I just targeted the branch in my podfile and I can confirm: as expected, it is now working 🙌

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

Successfully merging a pull request may close this issue.

5 participants