I'm trying to resolve an Segmentation Fault with Cross-references to modules. Don't know how to make this work. Part of error below:
1. While reading from /Users/damiandudycz/Library/Developer/Xcode/DerivedData/Hypno-azmcjycezcoqnfauqcbgimvipjyj/Build/Intermediates/Hypno.build/Debug-iphonesimulator/Hypno.build/Objects-normal/x86_64/WorldObjectBasedAugmentedRealityObject~partial.swiftmodule
2. While deserializing 'WorldObjectBasedAugmentedRealityObject' (ClassDecl #12)
3. While deserializing decl #31 (XREF)
4. Cross-reference to module 'AugmentedReality'
... AugmentedRealityView
... in an extension in module 'AugmentedReality'
... Object
5. While loading members for 'AugmentedRealityView' at <invalid loc>
6. While deserializing 'init' (ConstructorDecl #5)
7. While deserializing decl #33 (XREF)
8. Cross-reference to module 'UIKit'
... UIView
... init
... with type (UIView.Type) -> (CGRect) -> UIView
Problem occurs when I'm subclassing a class that is a subclass of something from other module. And this class in other module inherits from UIView. I have prepared an "empty" project version - I deleted most of the files and definitions, only empty classes are left and modules. Could someone help me with this? Problem shows in class GoogleARObject - when this class is deleted or commented it compiles.
Project with empty classes: https://dl.dropboxusercontent.com/u/40968624/Hypno.zip
Update:
After having a deeper look in the issue it turns out that my answer is wrong.
Your code should compile fine, as you do not subclass
AugmentedRealityView
but a nested class.The actual issue looks like a compiler bug to me.
You can fix the issue by changing the
Swift Compiler
-Optimization Level
toFast, Whole Module Optimization
instead ofNone
:Original Answer:
You are trying to inherit from a class (
AugmentedRealityView
) from outside the module the class is defined in, but it is markedpublic
andfinal
:final
forbids to inherit from this class in general.public
allows to subclass from within the module the class is defined in (in Swift3).To make a class subclass-able from outside the module it is defined in, use
open
(new in Swift3):To learn more, read this
...
This error happens when you are referencing 2 different version of a same Framework at the same time. This can be the case when your code is using a different Swift version than one used by the library.
Try to use the same version of Swift than the one used by Google AR.
I know this question is old, but I just encountered the same error:
The solution in my case was to disable
Use Legacy Swift Language Version
(of course if it's possible for your project).