Eureka: Xcode 12.1 Compiler Error "FormViewController"

Created on 2 Nov 2020  路  7Comments  路  Source: xmartlabs/Eureka

image

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

  • Environment: Eureka Pod 5.3.1

Most helpful comment

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 馃檹

All 7 comments

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

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 馃檹

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 https://github.com/onevcat/Kingfisher/issues/1530)

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

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?

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

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

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

Was this page helpful?
0 / 5 - 0 ratings