react-native和GVRKit之间的符号重复

时间:2019-11-04 11:32:39

标签: ios xcode react-native virtual-reality 360-virtual-reality

我正在尝试让我的iOS react-native应用程序(支持VR)中播放360部视频

我尝试使用各种提供此功能的react-native npm软件包,它们在Android上有效,但在iOS上无效。 (而且大多数至少有两年没有更新了……)

我决定尝试制作自己的包装,以查看是否可以自己解决问题。但是,似乎本机iOS和GVRKit不兼容。

我收到“用于架构x86_64的7个重复符号”:

重复的符号“ fLB :: FLAGS_nolog_prefix”位于:

    /Users/beau/Documents/MMT/ModuleTester/ios/Pods/GVRSDK/Libraries/libGVRSDK.a(logging_ddb19c79df368f1c1db7fe052bc2a5d9.o)
    /Users/beau/Library/Developer/Xcode/DerivedData/ModuleTester-eaufazkgozuyyvfhpezutrvzceza/Build/Products/Debug-iphonesimulator/glog/libglog.a(logging.o)
duplicate symbol 'fLB::FLAGS_log_prefix' in:
    /Users/beau/Documents/MMT/ModuleTester/ios/Pods/GVRSDK/Libraries/libGVRSDK.a(logging_ddb19c79df368f1c1db7fe052bc2a5d9.o)
    /Users/beau/Library/Developer/Xcode/DerivedData/ModuleTester-eaufazkgozuyyvfhpezutrvzceza/Build/Products/Debug-iphonesimulator/glog/libglog.a(logging.o)
duplicate symbol 'fLB::FLAGS_nosymbolize_stacktrace' in:
    /Users/beau/Documents/MMT/ModuleTester/ios/Pods/GVRSDK/Libraries/libGVRSDK.a(examine_stack_fca476d0593b9f715e19264b75811e08.o)
    /Users/beau/Library/Developer/Xcode/DerivedData/ModuleTester-eaufazkgozuyyvfhpezutrvzceza/Build/Products/Debug-iphonesimulator/glog/libglog.a(utilities.o)
duplicate symbol 'fLB::FLAGS_symbolize_stacktrace' in:
    /Users/beau/Documents/MMT/ModuleTester/ios/Pods/GVRSDK/Libraries/libGVRSDK.a(examine_stack_fca476d0593b9f715e19264b75811e08.o)
    /Users/beau/Library/Developer/Xcode/DerivedData/ModuleTester-eaufazkgozuyyvfhpezutrvzceza/Build/Products/Debug-iphonesimulator/glog/libglog.a(utilities.o)
duplicate symbol 'fLI::FLAGS_nov' in:
    /Users/beau/Documents/MMT/ModuleTester/ios/Pods/GVRSDK/Libraries/libGVRSDK.a(vlog_is_on_0129e25e84d5880e84b763ce61020e1c.o)
    /Users/beau/Library/Developer/Xcode/DerivedData/ModuleTester-eaufazkgozuyyvfhpezutrvzceza/Build/Products/Debug-iphonesimulator/glog/libglog.a(vlog_is_on.o)
duplicate symbol 'fLI::FLAGS_v' in:
    /Users/beau/Documents/MMT/ModuleTester/ios/Pods/GVRSDK/Libraries/libGVRSDK.a(vlog_is_on_0129e25e84d5880e84b763ce61020e1c.o)
    /Users/beau/Library/Developer/Xcode/DerivedData/ModuleTester-eaufazkgozuyyvfhpezutrvzceza/Build/Products/Debug-iphonesimulator/glog/libglog.a(vlog_is_on.o)
duplicate symbol 'fLS::FLAGS_vmodule' in:
    /Users/beau/Documents/MMT/ModuleTester/ios/Pods/GVRSDK/Libraries/libGVRSDK.a(vlog_is_on_0129e25e84d5880e84b763ce61020e1c.o)
    /Users/beau/Library/Developer/Xcode/DerivedData/ModuleTester-eaufazkgozuyyvfhpezutrvzceza/Build/Products/Debug-iphonesimulator/glog/libglog.a(vlog_is_on.o)
ld: 7 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

我无法获得GVRKit和本机反应来相处,是否自己可以解决这些错误?

欢迎提出任何建议!提前致谢! 博

修改

我尝试使用此shell脚本(与react-native-gvr一起使用),但它什么都没有改变:

    #!/bin/bash

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

# Divide to each platform
lipo -thin armv7 libGVRSDK.a -output libGVRSDK_armv7
lipo -thin i386 libGVRSDK.a -output libGVRSDK_i386
lipo -thin x86_64 libGVRSDK.a -output libGVRSDK_x86_64
lipo -thin arm64 libGVRSDK.a -output libGVRSDK_arm64

# Delete duplicate file
chmod 777 libGVRSDK_armv7
chmod 777 libGVRSDK_i386
chmod 777 libGVRSDK_x86_64
chmod 777 libGVRSDK_arm64

ar -dv libGVRSDK_armv7 vlog_is_on.o
ar -dv libGVRSDK_i386 vlog_is_on.o
ar -dv libGVRSDK_x86_64 vlog_is_on.o
ar -dv libGVRSDK_arm64 vlog_is_on.o

# rm libGVRSDK.a
lipo -create libGVRSDK_armv7 libGVRSDK_i386 libGVRSDK_x86_64 libGVRSDK_arm64 -output libGVRSDK.a

# Delete media
rm libGVRSDK_armv7
rm libGVRSDK_i386
rm libGVRSDK_x86_64
rm libGVRSDK_arm64

cd ../../../

吊舱安装输出:

Architectures in the fat file: libGVRSDK.a are: armv7 i386 x86_64 arm64 
ar: vlog_is_on.o: not found in archive
ar: vlog_is_on.o: not found in archive
ar: vlog_is_on.o: not found in archive
ar: vlog_is_on.o: not found in archive
Integrating client project

我尝试用logging.o和Utility.o替换vlog_is_on.o来查看会发生什么,但也找不到它们。

任何帮助将不胜感激;)谢谢!

0 个答案:

没有答案