美文网首页
webrtc编译填坑记录

webrtc编译填坑记录

作者: panjinya | 来源:发表于2020-04-30 09:28 被阅读0次

    参考别人的文档

    WebRTC填坑wiki

    一、下载源码

    1.国内镜像

    由于一些特殊原因,最好采用国内镜像下载。参考webrtc国内镜像

    2.windows

    二、编译源码

    1.ios/Mac

    参考webrtc国内镜像中编译ios/Mac版本的命令,但有可能出现一些问题。

    • python版本太高
      比如python3.*,执行命令
     gclient sync --patch-ref=https://chromium.googlesource.com/chromium/src/build.git@gitlab
    

    出现错误如下:

    /Users/username/Workspace/webrtc/depot_tools/update_depot_tools sync --patch-ref=https://chromium.googlesource.com/chromium/src/build.git@gitlab
    Traceback (most recent call last):
      File "/Users/username/Workspace/webrtc/depot_tools/metrics.py", line 267, in print_notice_and_exit
        yield
      File "/Users/username/Workspace/webrtc/depot_tools/gclient.py", line 3168, in <module>
        sys.exit(main(sys.argv[1:]))
      File "/Users/username/Workspace/webrtc/depot_tools/gclient.py", line 3154, in main
        return dispatcher.execute(OptionParser(), argv)
      File "/Users/username/Workspace/webrtc/depot_tools/subcommand.py", line 252, in execute
        return command(parser, args[1:])
      File "/Users/username/Workspace/webrtc/depot_tools/gclient.py", line 2711, in CMDsync
        ret = client.RunOnDeps('update', args)
      File "/Users/username/Workspace/webrtc/depot_tools/gclient.py", line 1716, in RunOnDeps
        self._CheckConfig()
      File "/Users/username/Workspace/webrtc/depot_tools/gclient.py", line 1364, in _CheckConfig
        actual_url = scm.GetActualRemoteURL(self._options)
      File "/Users/username/Workspace/webrtc/depot_tools/gclient_scm.py", line 153, in GetActualRemoteURL
        actual_remote_url = self._get_first_remote_url(self.checkout_path)
      File "/Users/username/Workspace/webrtc/depot_tools/gclient_scm.py", line 141, in _get_first_remote_url
        return log.splitlines()[0].split(' ', 1)[1]
    TypeError: a bytes-like object is required, not 'str'
    

    解决方法:此时把python改为2.7.*就可以了,我是用anaconda创建的虚拟环境,python2.7.17,这样就可以啦。

    • ios证书签名问题
      执行命令生成xcode工程文件,
    gn gen out/ios --args='target_os="ios" target_cpu="arm64" is_component_build=false' --ide=xcode
    

    出现错误:

    Automatic code signing identity selection was enabled but could
    not find exactly one code signing identity matching
    iPhone Developer. Check that your keychain
    is accessible and that there is a valid code signing identity
    listed by `xcrun security find-identity -v -p codesigning`
    TIP: Simulator builds don't require code signing...
    ERROR at //build/config/ios/ios_sdk.gni:142:7: Assertion failed.
          assert(false)
    

    解决方法1:修改配置,不使用签名证书,命令如下

    gn gen out/ios --args='target_os="ios" target_cpu="arm64" is_component_build=false ios_enable_code_signing=false' --ide=xcode 
    

    相关文章

      网友评论

          本文标题:webrtc编译填坑记录

          本文链接:https://www.haomeiwen.com/subject/lamawhtx.html