我目前正在将React Native与Expo结合使用来构建应用程序。我不得不退出Expo,因为Expo不支持WebRTC,这对我的应用程序至关重要,因为WebRTC严重依赖于Twilio Video。我正在尝试使用以下库:https://github.com/blackuy/react-native-twilio-video-webrtc 我已按照安装说明进行操作,但无法使其运行。这些是我得到的3个错误:
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_TVIVideoClient", referenced from:
objc-class-ref in libTWReactNativeTwilioVideoWebrtc.a(TWVideoModule.o)
"_OBJC_CLASS_$_TVILocalMedia", referenced from:
objc-class-ref in libTWReactNativeTwilioVideoWebrtc.a(TWVideoModule.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
我已经在线尝试了几种解决方案,包括清理,使用“构建设置”等都无济于事。
这是我经历的过程:
pod 'TwilioVideo'
添加到了Podfile pod install
这是我的Podfile:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
target 'teledoctor24' do
pod 'ExpoKit',
:git => "http://github.com/expo/expo.git",
:tag => "ios/2.11.2",
:subspecs => [
"Core"
],
:inhibit_warnings => true
# Install unimodules
require_relative '../node_modules/react-native-unimodules/cocoapods.rb'
use_unimodules!(
modules_paths: ['../node_modules'],
exclude: [
'expo-face-detector',
'expo-payments-stripe',
],
)
pod 'React',
:path => "../node_modules/react-native",
:inhibit_warnings => true,
:subspecs => [
"Core",
"ART",
"RCTActionSheet",
"RCTAnimation",
"RCTCameraRoll",
"RCTGeolocation",
"RCTImage",
"RCTNetwork",
"RCTText",
"RCTVibration",
"RCTWebSocket",
"DevSupport",
"CxxBridge"
]
pod 'yoga',
:path => "../node_modules/react-native/ReactCommon/yoga",
:inhibit_warnings => true
pod 'DoubleConversion',
:podspec => "../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec",
:inhibit_warnings => true
pod 'Folly',
:podspec => "../node_modules/react-native/third-party-podspecs/Folly.podspec",
:inhibit_warnings => true
pod 'glog',
:podspec => "../node_modules/react-native/third-party-podspecs/glog.podspec",
:inhibit_warnings => true
pod 'TwilioVideo'
pod 'react-native-randombytes', :path => '../node_modules/react-native-randombytes'
pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'
post_install do |installer|
installer.pods_project.main_group.tab_width = '2';
installer.pods_project.main_group.indent_width = '2';
installer.target_installation_results.pod_target_installation_results
.each do |pod_name, target_installation_result|
if pod_name == 'ExpoKit'
target_installation_result.native_target.build_configurations.each do |config|
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)']
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << 'EX_DETACHED=1'
# Enable Google Maps support
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << 'HAVE_GOOGLE_MAPS=1'
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << 'HAVE_GOOGLE_MAPS_UTILS=1'
end
end
if ['Amplitude-iOS','Analytics','AppAuth','Branch','CocoaLumberjack','FBSDKCoreKit','FBSDKLoginKit','FBSDKShareKit','GPUImage','JKBigInteger2'].include? pod_name
target_installation_result.native_target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '10.0'
end
end
# Can't specify this in the React podspec because we need to use those podspecs for detached
# projects which don't reference ExponentCPP.
if pod_name.start_with?('React')
target_installation_result.native_target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '10.0'
config.build_settings['HEADER_SEARCH_PATHS'] ||= ['$(inherited)']
end
end
# Build React Native with RCT_DEV enabled and RCT_ENABLE_INSPECTOR and
# RCT_ENABLE_PACKAGER_CONNECTION disabled
next unless pod_name == 'React'
target_installation_result.native_target.build_configurations.each do |config|
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)']
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << 'RCT_DEV=1'
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << 'RCT_ENABLE_INSPECTOR=0'
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << 'ENABLE_PACKAGER_CONNECTION=0'
end
end
end
end
任何帮助将不胜感激。