从 Android 的源代码构建 WebRTC 时出错

Posted

技术标签:

【中文标题】从 Android 的源代码构建 WebRTC 时出错【英文标题】:Error building WebRTC from source for Android 【发布时间】:2022-01-18 18:42:45 【问题描述】:

我在从 Chromium 设置和本地构建获取 webrtc 时遇到了问题。在运行gclient sync 时,出现以下错误:

________ running 'python3 src/build/linux/sysroot_scripts/install-sysroot.py --arch=i386' in '/Users/nbishop/code/ex/webrtc_custom/build_webrtc/webrtc/android'
Installing Debian sid i386 root image: /Users/nbishop/code/ex/webrtc_custom/build_webrtc/webrtc/android/src/build/linux/debian_sid_i386-sysroot
Downloading https://commondatastorage.googleapis.com/chrome-linux-sysroot/toolchain/23d12100f83139fc55349a841214d5d0bbd85a8d/debian_sid_i386_sysroot.tar.xz
Failed to download https://commondatastorage.googleapis.com/chrome-linux-sysroot/toolchain/23d12100f83139fc55349a841214d5d0bbd85a8d/debian_sid_i386_sysroot.tar.xz
Error: Command 'python3 src/build/linux/sysroot_scripts/install-sysroot.py --arch=i386' returned non-zero exit status 1 in /Users/nbishop/code/ex/webrtc_custom/build_webrtc/webrtc/android
Installing Debian sid i386 root image: /Users/nbishop/code/ex/webrtc_custom/build_webrtc/webrtc/android/src/build/linux/debian_sid_i386-sysroot
Downloading https://commondatastorage.googleapis.com/chrome-linux-sysroot/toolchain/23d12100f83139fc55349a841214d5d0bbd85a8d/debian_sid_i386_sysroot.tar.xz
Failed to download https://commondatastorage.googleapis.com/chrome-linux-sysroot/toolchain/23d12100f83139fc55349a841214d5d0bbd85a8d/debian_sid_i386_sysroot.tar.xz

这是在 Mac 上。我可以下载 tar.xz 就好了,但是由于某种原因脚本在这部分失败了。 python --version 返回 2.7.16,尽管我也尝试过使用别名为 python3 的 python。

【问题讨论】:

【参考方案1】:

看起来 webrtc for android 只能在 Linux 上构建,这就是 gclient 同步/安装构建工具在 MacOS 上不起作用的原因。

【讨论】:

您的答案可以通过额外的支持信息得到改进。请edit 添加更多详细信息,例如引用或文档,以便其他人可以确认您的答案是正确的。你可以找到更多关于如何写好答案的信息in the help center。

以上是关于从 Android 的源代码构建 WebRTC 时出错的主要内容,如果未能解决你的问题,请参考以下文章

如何构建一个可以进行基本视频通话的简单 Native WebRTC Android 应用程序?

Android无法在通信过程中从相机切换到屏幕共享webrtc

Android WebView 和 webrtc hello world 示例

使用ninja -C out/Release指令编译安卓Webrtc的SDK报错找不到android ndk处理方式

为 iOS 构建 webrtc 库时出错

为 Android 编译 Web RTC 时出错