duplicate symbols for architecture armv7

前端 未结 16 1634
遥遥无期
遥遥无期 2020-12-01 01:46

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         


        
相关标签:
16条回答
  • 2020-12-01 02:20

    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

    0 讨论(0)
  • 2020-12-01 02:21

    YOU MIGHT HAVE SIMILAR PLUGINS INSTALLED.

    I am using Cordova, and also had several duplicate symbol errors. I had installed two similar plugins:

    • cordova plugin email composer
    • cordova plugin email

    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!

    0 讨论(0)
  • 2020-12-01 02:26

    Happens with static variables in a header file (header file included in more than one implementations file).

    0 讨论(0)
  • 2020-12-01 02:26

    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.

    0 讨论(0)
  • 2020-12-01 02:26

    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..

    0 讨论(0)
  • 2020-12-01 02:26

    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.

    0 讨论(0)
提交回复
热议问题