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
Be careful if you're using Cordova iOS 4.5.0
, an error of this kind may happen
duplicate symbol _OBJC_METACLASS_$_CDVLogger in:
/Users/toto/Library/Developer/Xcode/DerivedData/imp-hkzujazvkracgugyxunzwnzpeiqx/Build/Intermediates/imp.build/Debug-iphoneos/imp.build/Objects-normal/armv7/CDVLogger.o
/Users/toto/Library/Developer/Xcode/DerivedData/imp-hkzujazvkracgugyxunzwnzpeiqx/Build/Products/Debug-iphoneos/libCordova.a(CDVLogger.o)
ld: 2 duplicate symbols for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
It can be due to the use of cordova-plugin-console
, which is not useful anymore in Cordova iOS 4.5.0
(and breaks the build too!).
To fix it
cordova plugin remove cordova-plugin-console
See reference : https://cordova.apache.org/announcements/2017/09/08/ios-release.html
YOU MIGHT HAVE SIMILAR PLUGINS INSTALLED.
I am using Cordova, and also had several duplicate symbol errors. I had installed two similar plugins:
Fixed it by removing "cordova plugin email" using...
cordova plugin remove cordova-plugin-email
After that I ran...
cordova prepare
cordova build ios
Now my xCode build ran like a charm! Woooo Hooo!
Happens with static variables in a header file (header file included in more than one implementations file).
I was getting this error because I used the Xcode recommended warning flags. GCC_NO_COMMON_BLOCKS = YES was causing the issue. Setting this back to NO fixed it for me.
Its because the iPhone simulator got duplicate .h & .m references. I struggled for hours for this bug.
My solution was simple. I copied the project to my pen drive and erased from computer memory.
Opened a new project, copied the storyboard and added the .h &.m files. Some errors fixed by selecting classes again in the storayboard view..
Please check if you have added any framework more then once, remove all framework if added multiple times and then drag and drop again.
Hope this will resolve your problem. Happy Coding.