3

I already gone so many SO threads with similar issue but none of them seems to resolve my error.

In our project we have multiple "TARGETS". Only one of the target - the very first target created ever - is archiving properly. When I try to archive other target we encounter this error

Undefined symbols for architecture arm64:
  "_OBJC_CLASS_$_DynamicEventData", referenced from:
      objc-class-ref in DataManager.o
      objc-class-ref in DataReader.o
  "_OBJC_CLASS_$_DynamicDataService", referenced from:
      objc-class-ref in DataManager.o
  "_OBJC_CLASS_$_DynamicDataConfig", referenced from:
      objc-class-ref in DataManager.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I did compare the Build Setting of the working target to the other targets but all of them are equal. I checked the header files and they exists in our project directory. I tried to manually add the header files' path to Header Search Paths but same result still getting the error.

Any idea? I really need to resolve this to export an ipa file.

Thanks!

SquareBox
  • 823
  • 1
  • 10
  • 22
  • Looks like a duplicate of [this question](https://stackoverflow.com/questions/38202639/ios-undefined-symbols-for-architecture-x86-64-xcode) – torstenvl Dec 20 '18 at 08:22

2 Answers2

0

I scan manually check the Build Phases > Link Binary With Libraries of the working target vs the defected targets. I found a one framework/library that was only added to the working target the said framework isn't manage by pod that may explain why the other target doesn't have it. I think it was added manually in the project.

I add the said framework to all targets and now I can build without the said error.

Thanks!

SquareBox
  • 823
  • 1
  • 10
  • 22
0

I encountered the same problem and the solution I found is so simple (man....). Search in the project for the classes that are mentioned in the error. Go to the "File Inspector" and simply check V for the rest of the targets in the "Targets Membership". That's it! It took me Two Hours (wasted time) to find out. Hope my solution will save time for anyone with similar problem.

Techno Mag
  • 31
  • 4