Closed nkezhaya closed 3 years ago
Where is the other definition of MessageView
?
Yep, definitely seems to be an issue in Xcode 12. pod deintegrate
and clearing of DerivedData didn't help.
@wtmoose The other definition is here: https://github.com/GitHawkApp/MessageViewController/blob/master/MessageViewController/MessageView.swift
:(
@wtmoose The solve was going through other libraries with conflicting class names and renaming it for the objc-bridge.
So in MessageViewController/MessageView.swift
, the file before was:
public final class MessageView: UIView, MessageTextViewListener {
Adding one line above:
@objc(ABCMessageView)
public final class MessageView: UIView, MessageTextViewListener {
Seems to avoid the naming conflicts.
I worked around this problem in my own apps by configuring the build to not create an Objective-C compatibility header. I'm using CocoaPods, so I added the following post install script to my Podfile:
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_INSTALL_OBJC_HEADER'] = 'NO'
end
end
end
And then in each of my app's targets, I also set SWIFT_INSTALL_OBJC_HEADER
to NO
in the target's build settings.
Sorry if this has been repeated a million times, but I'm getting this error with Xcode12 and Cocoapods:
'MessageView' has different definitions in different modules; first difference is definition in module 'SwiftMessages.Swift' found super class with type 'BaseView'
Issue is in SwiftMessages-Swift.h, line 284, SwiftMessages 8.0.2.