IOS - 2 duplicate characters for armv7 architecture

I use Resty everywhere in my project, but now, since I have to upload the image to the server, so I'm trying to add another RestKit framework to handle file upload. But when I compiled, he got an error:

duplicate symbol _NewBase64Decode in: /Users/iforests/Library/Developer/Xcode/DerivedData/Owlch-gnysrakcbhsgkubbjjjfbahlocqi/Build/Products/Debug-iphoneos/libRestKit.a(NSData+Base64.o) /Users/iforests/Documents/iOSworkspace/Owlch/LRResty.framework/LRResty(NSData+Base64.o) ld: 2 duplicate symbols for architecture armv7 clang: error: linker command failed with exit code 1 (use -v to see invocation) 

Is there any way to solve this problem without removing LRResty (since tomorrow is the deadline for this project). Thank you very much!

+6
source share
6 answers

Delete these files from the Resty source.

LRResty / Classes / Categories / NSData + Base64.h LRResty / Classes / Categories / NSData + Base64.m

This will be due to a binding problem.

If it stops working because of this, rename the files and category for NSData + Base64 to Resty code, and then somewhere the Resty code imports "NSData + Base64.h", change the import to everything that you renamed to the category

+4
source

I also came up with the same error. Typically, this error occurs due to duplication of classes and xibs in the project folder. For example, in my project, I had these classes twice ServiceRequest.h/.m . Get rid of duplicates, and you're good to go.

+4
source

Just this problem when importing a new library into an existing (old) project - it turns out that the problem was that the linker flag is -all_load , which (for some reason) is still set to " Build Settings - Linking - Other Linker Flags "in Xcode.

After removing this flag, everything went fine.

+4
source

The problem is that both libraries define the same method: NewBase64Decode.

So, you can change the source code of any library and change the method name to something else, for example, "RKNewBase64Decode". Do not forget to make changes to the * .m file, as well as wherever the NewBase64Decode method is called!

+1
source

In addition, I noted that if you stupidly imported .m, delete the import.

+1
source

This happened to me when importing a framework containing a class with the same name as in the project.

0
source

Source: https://habr.com/ru/post/924181/


All Articles