(一)WebRTC Android源码编译

  1. 首先在阿里云租用一台Ubuntu18.04+4核+16G内存+500G+100M带宽+香港的机器。

  1. ubuntu 安装ninja

  1. apt install pkg-config

  1. 安装必备工具depot

git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
export PATH=$PATH:${HOME}/depot_tools
  1. 同步相关代码

cd webrtc
mkdir code
cd code
fetch --nohooks webrtc_android
gclient sync
  1. 切换分支

关键版本对应分支

m84 branch-heads/4147 (2020年6月稳定)

m89 branch-heads/4389 (2021年2月稳定)

m93 branch-heads/4577 (2022年1月稳定)

关键版本支持的Android 版本

m84/4147 android:minSdkVersion="16" android:targetSdkVersion="23"

m89/4389 android:minSdkVersion="21" android:targetSdkVersion="23"

m93/4577 android:minSdkVersion="21" android:targetSdkVersion="23"

cd src
git checkout -b m84/4147 branch-heads/4147
cd ..
gclient sync
  1. 生成编译脚本

cd /src
gn gen out/Debug --args='target_os="android" target_cpu="arm"'
  1. 如果只生成so库执行

autoninja -C out/Debug
  1. 如果生成apk执行

autoninja -C out/Debug AppRTCMobile
  1. 生成Android demo app源码

生成在out/Debug/gradle

build/android/gradle/generate_gradle.py --output-directory $PWD/out/Debug \
  --target "//examples:AppRTCMobile" --use-gradle-process-resources \
  --split-projects --canary

webrtc编译常见问题集锦

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

༄yi笑奈何

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值