How to enable duplicate character in third-party platform in ios?

I am developing an Amazon and Google Plus account in my project. I added the Amazon project and Google plus to my project. when I try to build a project, it shows the error "Duplicate character in GooglePlus and Amazon Framework".

Error message

 duplicate symbol _kClientId in:
/Users/test/Amazon/Apps-SDK/iOS/LoginWithAmazon/LoginWithAmazon.framework/LoginWithAmazon(AIConstants.o)
/Users/test/GooglePlus/google-plus-ios-sdk-1.5.1/GooglePlus.framework/GooglePlus(GPPOzLogger.o)
 ld: 1 duplicate symbol for architecture i386
 clang: error: linker command failed with exit code 1 (use -v to see invocation)

How to solve this error?

+4
source share
3 answers

, , Google / Amazon . , _kClientId , . - , _kGooglePlus_iOS_Framework_ClientId _kAmazon_iOS_Framework_ClientId , .

, Google Plus Amazon, . , HEX, _kClientId .

+2

. , , , . , . , , ( , , ).

1) , ?

- , , lib. lib *.a . lib :

libFoo.a  /  i386  /
                      hello.o
                      world.o
             arm64 /  
                      hello.o
                      world.o

libFoo.a - , . , , .o() .

, :

duplicate symbol _kClientId in:
/Users/test/Amazon/Apps-SDK/iOS/LoginWithAmazon/LoginWithAmazon.framework/LoginWithAmazon(AIConstants.o)
/Users/test/GooglePlus/google-plus-ios-sdk-1.5.1/GooglePlus.framework/GooglePlus(GPPOzLogger.o)
ld: 1 duplicate symbol for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

, .o i386.

2) .

. , . .

AIConstants.o LoginWithAmazon i386:

lipo -info LoginWithAmazon //this is going to show us the architectures in the fat library
lipo LoginWithAmazon -thin i386 -output LoginWithAmazon-i386 //we extract the i386 architecture as xxx-i386 from fat library
//use the same command to extract every architecture from fat libraray as xxx-archname

ar -t LoginWithAmazon-i386 // list of symbols in this architecture, we should see AIConstants.o in it
ar -d LoginWithAmazon-i386 AIConstants.o // delete AIConstants.o from LoginWithAmazon-i386
//now work is done, we put everything back to the fat library

lipo LoginWithAmazon-i386 LoginWithAmazon-arm64 <every architecture you extracted from the fat library> -create -output LoginWithAmazon-new
ranlib -s LoginWithAmazon-new //sometime we need to rebuild the symbol table
//now you have done the work, use LoginWithAmazon-new to replace the old LoginWithAmazon, and try to compile your program again

REF:

http://blog.sigmapoint.pl/avoiding-dependency-collisions-in-ios-static-library-managed-by-cocoapods/

+1

It seems this issue is not a priority for logging in with the amazon command.

As a workaround (believe it or not), you can use a text editor and replace all occurrences of "_kClientId" in the LoginWithAmazon binary with something else (for example, "_kClientIe").

See also my answer here:

https://github.com/aws/aws-sdk-ios/issues/18

0
source

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


All Articles