Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linker clash with GVRSDK (vlog_is_on.o) #18022

Closed
shauntc opened this issue Feb 19, 2018 · 13 comments
Closed

Linker clash with GVRSDK (vlog_is_on.o) #18022

shauntc opened this issue Feb 19, 2018 · 13 comments
Labels
Platform: iOS iOS applications. Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@shauntc
Copy link

shauntc commented Feb 19, 2018

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

@react-native-bot react-native-bot added the Platform: iOS iOS applications. label Mar 13, 2018
@Tankerxyz

This comment has been minimized.

@shauntc
Copy link
Author

shauntc commented 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")

@Tankerxyz
Copy link

@shauntc thanks, it works for me.

@ttDemon
Copy link

ttDemon commented May 11, 2018

I have followed the guide, but it generates this error when running.
screen shot 2018-05-11 at 11 25 12 am

@shauntc
Copy link
Author

shauntc commented May 11, 2018

@ttDemon Need some more context here:
What versions of react/gvrsdk are you running?
What symbols were clashing before?
What does your post install script look like?

@ttDemon
Copy link

ttDemon commented May 12, 2018


"react": "16.3.0-alpha.1",
"react-native": "0.54.3",
"GVRSDK": "1.140.0",

symbols were clashing before:

screen shot 2018-05-10 at 10 37 05 am


my post install 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 ../../../


@shauntc If I do not add post install script then I run release mod ok, but debug will report duplicate error as above image

@react-native-bot
Copy link
Collaborator

Thanks for posting this! It looks like your issue may refer to an older version of React Native. Can you reproduce the issue on the latest release, v0.55?

Thank you for your contributions.

@crakaC
Copy link

crakaC commented May 22, 2018

This problem still occurs.

React-Native v0.55.4
Xcode 9.3.1
GVRSDK 1.140.0

@crakaC

This comment has been minimized.

@fabianlee1211
Copy link

I am having the same issue as @ttDemon.
Any solution up until now?
I'm running
RN 0.56.0
XCode 9.1
GVRSDK 1.140.0

@e6a5
Copy link

e6a5 commented Sep 5, 2018

I am getting the same issue as @ttDemon and @fabianlee1211.
RN 0.56.0
XCode 9.2
GVRSDK 1.140.0

@stale
Copy link

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.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Dec 4, 2018
@stale
Copy link

stale bot commented Dec 11, 2018

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.

@stale stale bot closed this as completed Dec 11, 2018
@facebook facebook locked as resolved and limited conversation to collaborators Dec 12, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Platform: iOS iOS applications. Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests

8 participants