Reputation: 91
EDIT Seems like the issue has been drilled down to the fact that it builds in debug mode but not in release mode. Still trying to understand why it builds in one and not the other
ORIGINAL ISSUE
I have a Xcode workspace with the following structure.
Workspace:
FrameworkB is nested in FrameworkA so FrameworkA is dependent on FrameworkB. Both are custom frameworks that I have created.
It builds and compiles fine. When I try to archive it, I get the following error:
Undefined symbols for architecture armv7:
"ADI4ONS.Connection4ONS.connectionStat.getter : Swift.Bool", referenced from:
type metadata for AircraftServices.connection in Connection.o
"ADI4ONS.Connection4ONS.connectionStat.setter : Swift.Bool", referenced from:
type metadata for AircraftServices.connection in Connection.o
"ADI4ONS.Connection4ONS.connectionStat.materializeForSet : Swift.Bool", referenced from:
type metadata for AircraftServices.connection in Connection.o
"ADI4ONS.Connection4ONS.connectionString.getter : Swift.String", referenced from:
type metadata for AircraftServices.connection in Connection.o
"ADI4ONS.Connection4ONS.connectionString.setter : Swift.String", referenced from:
type metadata for AircraftServices.connection in Connection.o
"ADI4ONS.Connection4ONS.connectionString.materializeForSet : Swift.String", referenced from:
type metadata for AircraftServices.connection in Connection.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Where ADI4ONS is frameworkB and AircraftServices is FrameworkA. Any help is welcomed.
Project/Target Configuration
Experiments Tried Some of the things I've tried
Tried setting Archive to Debug ( instead of the default Release in edit schema ) : NO LUCK
Created a separate workspace for the UIProject and imported the frameworks binary into that . Archives successfully : WORKS GREAT ( but not what I want )
Upvotes: 4
Views: 1678
Reputation: 91
Alright, After a ton of research and experimentation, here's my result.
So I figured out the parameter that was causing issues in Release mode build. It is the “Swift Compiler – Code Generation: Optimization Level”. It has three values
I was trying to research more into the WMO but didn’t dig too deep into it. Seems like it was introduced in Xcode 7 .
Also my frameworks were both in Swift .
Upvotes: 3