question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Linker clash with GVRSDK (vlog_is_on.o)

See original GitHub issue

Is this a bug report?

Yes

Have you read the Contributing Guidelines?

Yes

Environment

Environment: OS: macOS High Sierra 10.13.3 Node: 7.9.0 Yarn: 0.23.2 npm: 4.2.0 Watchman: 4.7.0 Xcode: Xcode 9.2 Build version 9C40b Android Studio: 3.0 AI-171.4443003

Packages: (wanted => installed) react: ^16.2.0 => 16.2.0 react-native: ^0.53.0 => 0.53.0

Steps to Reproduce

  1. Initialize a react-native project with react-native init
  2. Initialize cocoapods and add “pod ‘GVRSDK’” to the pod file, run pod install
  3. open workspace, run project in xcode or via react-native run-ios

Expected Behavior

Run without linker error

Actual Behavior

Fails to link with the following error:

duplicate symbol __ZN3fLI9FLAGS_novE in:
 /test_proj/ios/Pods/GVRSDK/Libraries/libGVRSDK.a(vlog_is_on_8d2e7d29c7bb2e5dfa3670dcea4320a0.o)
    /Library/Developer/Xcode/DerivedData/test_proj-btwdvvwnrjygbfeqvozqudjeesra/Build/Products/Debug-iphoneos/libReact.a(vlog_is_on.o)
duplicate symbol __ZN3fLI7FLAGS_vE in:
    /test_proj/ios/Pods/GVRSDK/Libraries/libGVRSDK.a(vlog_is_on_8d2e7d29c7bb2e5dfa3670dcea4320a0.o)
    /Library/Developer/Xcode/DerivedData/test_proj-btwdvvwnrjygbfeqvozqudjeesra/Build/Products/Debug-iphoneos/libReact.a(vlog_is_on.o)
ld: 2 duplicate symbols for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Reproducible Demo

https://github.com/shauntc/ReactNativeGVRSDKLinkerFailure run ‘pod install’ in ios/ to install cocoapods

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:13

github_iconTop GitHub Comments

6reactions
shauntccommented, Mar 13, 2018

@Tankerxyz

Our temporary fix for this is to remove it from the GVRSDK lib using this shell script:

#!/bin/bash

cd ./Pods/GVRSDK/Libraries/
lipo -info libGVRSDK.a

architectures="armv7 i386 x86_64 arm64"
for arch in $architectures
do
    echo Create thin archive libGVRSDK_$arch
    lipo -thin $arch libGVRSDK.a -output libGVRSDK_$arch
    chmod 777 libGVRSDK_$arch

    remove=""
    for object in $(ar -t libGVRSDK_$arch)
    do
        if [[ ${object} == vlog_is_on_* ]]
        then
            echo $object
            remove=$object
        fi
    done

    if [ $remove ]
    then
        echo removing $remove from $arch
        ar -dv libGVRSDK_$arch $remove
    else
        echo No symbol matching "vlog_is_on_*" found for $arch
    fi

done

echo Rebuild libGVRSDK.a
lipo -create libGVRSDK_armv7 libGVRSDK_i386 libGVRSDK_x86_64 libGVRSDK_arm64 -output libGVRSDK.a

for arch in $architectures
do
    rm libGVRSDK_$arch
    echo Delete thin archive libGVRSDK_$arch
done

cd ../../../

Adding this to the end of our podfile to run it after each time we run pod install:

# Hack to fix linker error between GVRSDK and React
post_install do |installer|
    system(". ./pod_post_install.sh")
end

(the script is saved in the same directory as the podfile as “pod_post_install.sh”)

1reaction
stale[bot]commented, Dec 4, 2018

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community’s attention? This issue may be closed if no further activity occurs. You may also label this issue as “For Discussion” or “Good first issue” and I will leave it open. Thank you for your contributions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found