1

更新到 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

有什么建议我应该怎么做才能克服它?

4

1 回答 1

0

使用以下作为参数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论证。

于 2021-04-30T05:40:27.100 回答