当我尝试将Google VR SDK ('GVRSDK') 添加为 Podfile 依赖项时,我在使用 React Native 时遇到了问题,而且它很容易复制。
脚步:
- 创建一个新的空白 React Native 项目。运行它
react-native run-ios
以确保它正常工作。 cd ios
pod init
- 添加
pod 'GVRSDK'
到 Podfile,执行pod update
cd ..
react-native run-ios
该项目因以下错误而崩溃:
duplicate symbol __ZN3fLI9FLAGS_novE in:
/foo/ios/Pods/GVRSDK/Libraries/libGVRSDK.a(vlog_is_on.o)
/foo/ios/build/Build/Products/Debug-iphonesimulator/libReact.a(vlog_is_on.o)
duplicate symbol __ZN3fLI7FLAGS_vE in:
/foo/ios/Pods/GVRSDK/Libraries/libGVRSDK.a(vlog_is_on.o)
/foo/ios/build/Build/Products/Debug-iphonesimulator/libReact.a(vlog_is_on.o)
duplicate symbol __ZN6google13RemoveLogSinkEPNS_7LogSinkE in:
/foo/ios/build/Build/Products/Debug-iphonesimulator/libReact.a(logging.o)
/foo/ios/Pods/GVRSDK/Libraries/libGVRSDK.a(logging.o)
duplicate symbol __ZN6google10AddLogSinkEPNS_7LogSinkE in:
/foo/ios/build/Build/Products/Debug-iphonesimulator/libReact.a(logging.o)
/foo/ios/Pods/GVRSDK/Libraries/libGVRSDK.a(logging.o)
ld: 4 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
** BUILD FAILED **
The following build commands failed:
Ld build/Build/Products/Debug-iphonesimulator/foo.app/foo normal x86_64
(1 failure)