Getting following error when try to use Layar SDK in my existing app. How can I solve this?
Ld /Users/pnawale/Library/Developer/Xcode/DerivedData/hub-afxxzaq
This error can also be caused if you have cyclic imports.... lets suppose you have VC1.h
, VC2.h
, and VC3.h
examples that will cause the error: (all are the .h
files)
VC1
and VC1 imports VC2
VC2
and VC2 imports VC3
and VC3 imports VC1
solution:
.m
instead of the .h
.h
needs that class use @class (nameOfClass);
instead of importing the .h
Be careful when using #import
, only import what you need.
I was seeing the same issue, but with different libraries. The fix was the following:
Target -> Build Phases -> Linked Binary With Libraries
Make sure the libraries included make sense. In my case, my project had libPods*.a (I am using CocoaPods for dependency mgmt) but also a few libraries that were included in my pod shared libraries, and that was causing the duplicates.
The only thing that worked for me was to delete my Podfile and then reinstall it.
Make sure you make a copy of all of your original pods before running the following:
$ sudo gem install cocoapods-deintegrate
$ sudo gem install cocoapods-deintegrate cocoapods-clean
$ rm -rf ~/Library/Developer/Xcode/DerivedData
$ pod deintegrate
$ pod clean
$ rm Podfile
$ pod cache clean --all
$ pod init
// next add all the original pods to the new Podfile
$ pod install
My problem was... odd. I'm not sure how it happened, but at some point, Xcode decided to include some ancient .m
file one more time in its .pbxproj
file. The only way I found it was by comparing my changes in git, looking at the version of the code where the build first failed.
Simply removing this line solved my issue: