react-native-udp: Duplicate symbols with CocaAsyncSocket

Hey,

I just had an issue, I was blocked by for some time (still new to react-native), which is connected to this repo. I made a new react-native project with the react-native-cli and used rn-nodeify, because we use a lot of crypto.

Unfortunately, building failed, because of duplicated symbols. Here are the last lines:

duplicate symbol '_OBJC_IVAR_$_GCDAsyncUdpSocket.readStream4' in:
    /Users/username/Library/Developer/Xcode/DerivedData/ProjectName-heocgpjrcpddyfamfhwzjvkublko/Build/Products/Debug-iphoneos/CocoaAsyncSocket/libCocoaAsyncSocket.a(GCDAsyncUdpSocket.o)
    /Users/username/Library/Developer/Xcode/DerivedData/ProjectName-heocgpjrcpddyfamfhwzjvkublko/Build/Products/Debug-iphoneos/react-native-udp/libreact-native-udp.a(GCDAsyncUdpSocket.o)
ld: 144 duplicate symbols for architecture arm64

CocoaAsyncSocket is loaded as a dependency to flipperkit, which is loaded, because facebook/flipper is now loaded per default in new projects.

I solved this, by removing Flipper in my Podfile.

Since I am new to react-native development, I can’t give good recommendations, on what to do, but I guess I would just also use the same dependency?

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 15

Most upvoted comments

@Shing-Ho, take a look at this issue from react-native-tcp-socket, it might be related to your problem.

@Rapsssito There was not CocoaAsyncSocket but there was GCDAsyncSocket so I removed it and it worked. You are really awesome. @Rapsssito Thank you!!! Following you from now~

@Rapsssito There was not CocoaAsyncSocket but there was GCDAsyncSocket so I removed it and it worked. You are really awesome. @Rapsssito Thank you!!! Following you from now~

I have also removed GCDAsyncSocket but its duplicate architecture error goes from 144 to 65 duplicate symbols for architecture x86_64. kindly help if anybody can

Procedure:

-> Go to xcode -> into project navigator, click on Pods folder -> then select react-native-udp in targets -> Go to Build Phases > Compile sources Here remove reference to CocoaAsyncSocket or GCDAsyncUdp…

@Rapsssito There was not CocoaAsyncSocket but there was GCDAsyncSocket so I removed it and it worked. You are really awesome. @Rapsssito Thank you!!! Following you from now~

I have also removed GCDAsyncSocket but its duplicate architecture error goes from 144 to 65 duplicate symbols for architecture x86_64. kindly help if anybody can

Procedure:

-> Go to xcode -> into project navigator, click on Pods folder -> then select react-native-udp in targets -> Go to Build Phases > Compile sources Here remove reference to CocoaAsyncSocket or GCDAsyncUdp…

Isnt there a way to automate this? Otherwise we have to do this after every pod install