更新到 WebRTC 的 XCFramework 后出现错误。这是它的手动说明:https://swiftpackageregistry.com/alexpiezo/WebRTC
...missing required architecture armv7...
我不需要Mac,所以我的步骤是这样的:
gn gen ./out/ios_arm64 --args='target_os="ios" target_cpu="arm64" is_component_build=false is_debug=false ios_deployment_target="10.0" rtc_libvpx_build_vp9=true use_goma=false ios_enable_code_signing=false enable_stripping=true enable_ios_bitcode=false'
gn gen out/ios_x64 --args='target_os="ios" target_cpu="x64" is_component_build=false is_debug=false ios_deployment_target="10.0" rtc_libvpx_build_vp9=true use_goma=false ios_enable_code_signing=false enable_stripping=true enable_ios_bitcode=false'
ninja -C out/ios_arm64 sdk:framework_objc
ninja -C out/ios_x64 sdk:framework_objc
xcodebuild -create-xcframework \
-framework ./out/ios_arm64/WebRTC.framework \
-framework ./out/ios_x64/WebRTC.framework \
-output ./out/WebRTC.xcframework
它可以在 iOS 模拟器和真实设备上运行,但任何 iOS 设备(arm64、armv7)都不起作用。
Undefined symbol: _OBJC_CLASS_$_RTCMediaConstraints
Undefined symbol: _kRTCMediaStreamTrackKindVideo
Undefined symbol: _OBJC_CLASS_$_RTCAudioSessionConfiguration
Undefined symbol: _OBJC_CLASS_$_RTCAudioSession
Undefined symbol: _OBJC_CLASS_$_RTCIceCandidate
Undefined symbol: _OBJC_CLASS_$_RTCIceServer
Undefined symbol: _OBJC_CLASS_$_RTCConfiguration
Undefined symbol: _OBJC_CLASS_$_RTCCallbackLogger
Undefined symbol: _OBJC_CLASS_$_RTCPeerConnectionFactory
Undefined symbol: _OBJC_CLASS_$_RTCDispatcher
Undefined symbol: _OBJC_CLASS_$_RTCDefaultVideoDecoderFactory
Undefined symbol: _OBJC_CLASS_$_RTCSessionDescription
Undefined symbol: _RTCSetMinDebugLogLevel
Undefined symbol: _OBJC_CLASS_$_RTCRtpTransceiverInit
Undefined symbol: _OBJC_CLASS_$_RTCCameraVideoCapturer
Undefined symbol: _OBJC_METACLASS_$_RTCEAGLVideoView
Undefined symbol: _OBJC_CLASS_$_RTCDefaultVideoEncoderFactory
Undefined symbol: _OBJC_CLASS_$_RTCEAGLVideoView
有什么建议我应该做什么来克服它吗?
使用以下内容作为
gn gen
的参数:
--args='target_os="ios" ios_enable_code_signing=false use_xcode_clang=true is_component_build=false rtc_include_tests=false is_debug=false target_cpu="arm64" ios_deployment_target="10.0" rtc_libvpx_build_vp9=false enable_ios_bitcode=false use_goma=false rtc_enable_symbol_export=true enable_dsyms=true enable_stripping=true'
这里的关键是
rtc_enable_symbol_export=true
参数。
Большое спасибо, сделал мой вечер