Skip to content

iOS linker error adding Google Nearby Messages API to XCode project #16406

@dimutu-isobar

Description

@dimutu-isobar

Is this a bug report?

YES

Environment

Environment:
OS: macOS High Sierra 10.13
Node: 8.6.0
Yarn: 1.0.2
npm: 5.3.0
Watchman: 4.7.0
Xcode: Xcode 9.0 Build version 9A235
Android Studio: 2.3 AI-162.4069837

Packages: (wanted => installed)
react: 16.0.0-beta.5 => 16.0.0-beta.5
react-native: 0.49.3 => 0.49.3

Target Platform: iOS (10.0)

Steps to Reproduce

  1. react-native init SampleProject
  2. Follow Google Nearby Messages API installation guide (https://developers.google.com/nearby/messages/ios/get-started) to add Messaging API to react native XCode project
  3. compile XCode workspace project

Expected Behavior

There should not be any duplicated symbols between Google Nearby Messages API implementations with React ThirdParty implementation,
or a work around to avoid the duplication of these symbols to use Google Nearby API in a react native project.

Actual Behavior

Linker error for duplicated symbols.

duplicate symbol __ZN6google10AddLogSinkEPNS_7LogSinkE in:
    /Users/dimutu.k/Library/Developer/Xcode/DerivedData/nearby-axzoinmlhtvrrpfvlpxeomerfvml/Build/Products/Debug-iphoneos/libReact.a(logging.o)
    /Work/WINK/nearby/ios/gns/NearbyMessages/Libraries/libGNSMessages.a(logging.o)
duplicate symbol __ZN6google13RemoveLogSinkEPNS_7LogSinkE in:
    /Users/dimutu.k/Library/Developer/Xcode/DerivedData/nearby-axzoinmlhtvrrpfvlpxeomerfvml/Build/Products/Debug-iphoneos/libReact.a(logging.o)
    /Work/WINK/nearby/ios/gns/NearbyMessages/Libraries/libGNSMessages.a(logging.o)
ld: 2 duplicate symbols for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Reproducible Demo

Please run

npm install
cd ios
pod install

GNSMessageSampleProject.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    StaleThere has been a lack of activity on this issue and it may be closed soon.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions