react-native-maps: duplicate symbols for architecture x86_64
After dragging the AirMaps and AirGoogleMaps folders into my xcode project and running react-native run-ios, I get
ld: 175 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
** BUILD FAILED **
Full output here: http://pastebin.com/td7gRy9g
Anyone else have this issue or just me?
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 58
- Comments: 52 (5 by maintainers)
Commits related to this issue
- Reference install solution in issue #718 in install docs — committed to se1exin/react-native-maps by se1exin 7 years ago
- Reference install solution in issue #718 in install docs (#1448) — committed to react-native-maps/react-native-maps by se1exin 7 years ago
- Merge remote-tracking branch 'upstream/master' into feat/version-bump-upstream * upstream/master: Add minZoom and maxZoom properties for android and ios (#1360) Reference install solution in issu... — committed to Vizzuality/react-native-maps by deleted user 7 years ago
- Merge branch 'master' of github.com:Vizzuality/react-native-maps * 'master' of github.com:Vizzuality/react-native-maps: fix: error syntax on AirMaps max and min zoom level not nil check Add minZo... — committed to Vizzuality/react-native-maps by j8seangel 7 years ago
- Reference install solution in issue #718 in install docs (#1448) — committed to pjaraherrera/react-native-maps by se1exin 7 years ago
I resolved this issue and succesfully implemented GMaps on IOS simulator by the followings: (ref.: http://stackoverflow.com/questions/24298144/duplicate-symbols-for-architecture-x86-64)
Side effects from the link above: the app may become larger as there may be duplicated symbols during compile
Hope can help you. P.S. Not yet try on real device
Just chiming in, I finally got around the duplicate symbols problem on all build configs (Debug/Release/Archive) with the following steps:
Versions:
Install and link the regular react-native-maps module without using Pods!
npm install --save react-native-mapsreact-native-link react-native-mapsAt this point you should have the
AirMaps.xcodeprojunder your Libraries folder in XCode (screenshot 1), andlibAirMaps.aand the default React libs are in your Linked Frameworks and Libraries (screenshot 2)Now the fun stuff
Drag the
AirGoogleMapsfolder fromnode_modules/react-native-maps/lib/iosinto the top most level of your Xcode Project, and select add as ‘Create Groups’ when the popup appears after dropping the folder.AirGoogleMapsneeds theReactheaders, so add$(SRCROOT)/../node_modules/react-native/Reactto yourHeader Search Paths(under Build Settings in Xcode) and make it recursive. Double check the AirMaps path is in there as well (Screenshot 3)Now AirGoogleMaps should be completely linked, the GoogleMaps pod just needs to be installed.
Go to the Podfile, and add
pod 'GoogleMaps', and runpod install(Screenshot 4)Now run Run/Build/Archive, and it should all compile without duplicate symbols!
–
Please let me know if this works for anyone else, if it fixes the problem for everyone then I’ll make a PR to update the install documentation
Try to add code at the very end of Podfile:
@hafizmuhammadshoaib
react-native unlink react-native-maps; cd ios; pod install;Look at your
Podfile, take a note of all the modules declared in there and remove those exact modules in Xcode underLibraries. This helped forreact-native: 0.41.2.I have resolved it, this is my pod file below
#713
in my case these duplicate errors were occurring because I have .m files for these objects twice in xcode. Once because “pod install” has added AirMaps.xcodeproj to my project. And another because the react-native-maps instructions told me to drag the AirMaps files into my project. (https://github.com/airbnb/react-native-maps/blob/master/docs/installation.md)
I’m not sure why the instructions tell you to copy the files over - they’re already there! I resolved it simply by not copying the AirMaps folder into my project.
Followed @se1exin guide, but getting the error message about the missing AirGoogleMaps directory 😦
i just had to remove libairmaps.a from the search of build phases 😉
@alvelig Thankyou it works like a charm
@se1exin ~It’s not working for me on 0.47.1, is that correct?~
Wuuut, I didn’t follow the cleanup step because I thought it wasn’t needed. But it clearly was, it works now. Thanks, you saved me so much time!
@arthurnn As far as I remember its in Build Phases not Build Settings under Compile Sources or Link Binary With Libraries
This issue is already alive for 3 years. “react-native-maps”: “^0.24.2”, the same problem.
It worked for me, very Thanks
It works for me, thanks @mor12
If anyone is still having problems I followed this walkthrough and it worked perfectly. Very easy to follow and has step by step instructions. https://medium.com/@kswanie21/react-native-google-map-with-react-native-maps-572e3d3eee14
Hey @se1exin!
Thank you so much for your instructions! Do you have to add your Gmaps api key anywhere though? I ran your steps explicitly on a new react native project and it all worked great, but now I’m scratching my head about the API key stuff 😃
Thanks again!!
I was able to fix this issue by following @hzalaz instructions on this following (https://github.com/auth0/react-native-lock/issues/3).
In summary, the duplication issue because you a linking RCT**** Libraries twice, once in your PodFile and again in your SubProjects.
I got the same error and thanks to @jojonarte this step solved my problem: Removed Airmaps.xcodeproj and libairmaps if it exist in Libraries folder and Build Settings respectively.