Mac下 编译webrtc问题汇总
问题1:Simulator builds don't require code signing
.gclient file in parent directory /Users/willman/git/webrtc_ios might not be the file you want to use
Tried to prepare a device build without specifying a code signing
identity and could not detect one automatically either.
TIP: Simulator builds don't require code signing...
ERROR at //build/config/ios/ios_sdk.gni:143:7: Assertion failed.
assert(false)
^-----
See //build/config/sysroot.gni:65:3: whence it was imported.
import("//build/config/ios/ios_sdk.gni")
^--------------------------------------
See //build/config/linux/pkg_config.gni:5:1: whence it was imported.
import("//build/config/sysroot.gni")
^----------------------------------
See //BUILD.gn:15:1: whence it was imported.
import("//build/config/linux/pkg_config.gni")
^-------------------------------------------
解决办法:
添加配置
ios_enable_code_signing=false
例如:
# debug build for 64-bit iOS
gn gen out/ios_64 --args='target_os="ios" target_cpu="arm64" ios_enable_code_signing=false'
# debug build for simulator
gn gen out/ios_sim --args='target_os="ios" target_cpu="x64" ios_enable_code_signing=false'
# debug build for xcode
gn gen out/xcode --args='target_os="ios" target_cpu="arm64" ios_enable_code_signing=false' --ide=xcode
问题2:ninja版本冲突
note: Compile and copy AppRTCMobile via ninja
ninja: Entering directory `.'
ninja: fatal: ninja version (1.5.3) incompatible with build file ninja_required_version version (1.7.2).
Command /bin/sh failed with exit code 1
问题3:终端翻墙问题
一般我们是通过环境变量翻墙:
export HTTP_PROXY=127.0.0.1:1080
export HTTPS_PROXY=127.0.0.1:1080
但会sync失败,遇到的现象描述:
http://www.idom.me/articles/843.html
结论:终端环境变量翻墙:
谷歌的工程不支持访问。
报错如下:
NOTICE: You have PROXY values set in your environment, but gsutil in depot_tools does not (yet) obey them. Also, --no_auth prevents the normal BOTO_CONFIG environment variable from being used. To use a proxy in this situation, please supply those settings in a .boto file pointed to by the NO_AUTH_BOTO_CONFIG environment var.
这个就是告诉你,google 的这套工具不支持 HTTP_PROXY 环境变量做代理
(推测使用 VPN 也可以解决,设置 VPN,然后把其他的代理设置都关掉。)
按照提示清除环境变量,设置一个http_proxy.boto文件,随便在/depot_tools文件夹创建http_proxy.boto文件。
set NO_AUTH_BOTO_CONFIG=/Users/willman/git/depot_tools/http_proxy.boto
http_proxy.boto 文件内容如下:
[Boto]
proxy = 127.0.0.1
proxy_port = 8087
注意将 HTTP_PROXY 环境变量设为空是不行的,HTTP_PROXY 环境变量还是存在:
export http_proxy=
export HTTPS_PROXY=
echo $HTTPS_PROXY
要使用 unset 命令
unset HTTPS_PROXY
unset http_proxy
使用下面命令验证下:
echo $HTTPS_PROXY
如果什么都不打印,表示删除成功,如果有打印说明环境变量还在。
用同样的方法验证:
http_proxy
unset 后,就可以重新借助 .boto 翻墙下载了:
gclient runhooks
终端翻墙问题参考:
《使用代理同步Chromium代码的心得(V2.0)》 《[已解决]下载chromium源码 download_from_google_storage 无法下载文件》
问题4:Precompiled WebRTC Libraries
提供各平台各版本库。
https://sourcey.com/precompiled-webrtc-libraries/#
问题5:开箱即用的 WebRTC 开发环境
https://xiaozhuanlan.com/topic/2869371504
https://github.com/Piasy/webrtc-builds
https://github.com/pristineio/webrtc-build-scripts