WebRTC:忍者构建不起作用

Posted

技术标签:

【中文标题】WebRTC:忍者构建不起作用【英文标题】:WebRTC : ninja build not working 【发布时间】:2013-11-18 12:14:41 【问题描述】:

我在 UBUNTU 环境中构建 webRTC 所遵循的步骤。

查看代码:

 gclient config https://webrtc.googlecode.com/svn/trunk
 echo "target_os = ['android', 'unix']" >> .gclient
 gclient sync --nohooks

生成忍者makefile:

cd 后备箱

 $./build/install-build-deps-android.sh
 $. build/android/envsetup.sh
 Defaulting GYP_GENERATORS to ninja

 $gclient runhooks
 $android_gyp

android_gyp 的结果:

GYP_GENERATORS set to 'ninja'
Updating projects from gyp files...
gyp: /home/user/webRTC/trunk/chrome/chrome_resources.gyp not found (cwd: /home/user/webRTC/trunk)
gyp: /home/user/webRTC/trunk/tools/android/findbugs_plugin/findbugs_plugin.gyp not found (cwd: /home/user/webRTC/trunk)
gyp: /home/user/webRTC/trunk/sql/sql.gyp not found (cwd: /home/user/webRTC/trunk)
gyp: /home/user/webRTC/trunk/tools/android/android_tools.gyp not found (cwd: /home/user/webRTC/trunk)
gyp: /home/user/webRTC/trunk/sync/sync.gyp not found (cwd: /home/user/webRTC/trunk)
gyp: /home/user/webRTC/trunk/sandbox/sandbox.gyp not found (cwd: /home/user/webRTC/trunk)
gyp: /home/user/webRTC/trunk/net/net.gyp not found (cwd: /home/user/webRTC/trunk)
gyp: /home/user/webRTC/trunk/media/media.gyp not found (cwd: /home/user/webRTC/trunk)
gyp: /home/user/webRTC/trunk/ipc/ipc.gyp not found (cwd: /home/user/webRTC/trunk)
gyp: /home/user/webRTC/trunk/gpu/gpu.gyp not found (cwd: /home/user/webRTC/trunk)
gyp: /home/user/webRTC/trunk/components/components_tests.gyp not found (cwd: /home/user/webRTC/trunk)
gyp: /home/user/webRTC/trunk/base/base.gyp not found (cwd: /home/user/webRTC/trunk)
gyp: /home/user/webRTC/trunk/breakpad/breakpad.gyp not found (cwd: /home/user/webRTC/trunk)
gyp: /home/user/webRTC/trunk/base/android/jni_generator/jni_generator.gyp not found (cwd: /home/user/webRTC/trunk)
gyp: /home/user/webRTC/trunk/third_party/cacheinvalidation/cacheinvalidation.gyp not found (cwd: /home/user/webRTC/trunk)
gyp: /home/user/webRTC/trunk/remoting/remoting.gyp not found (cwd: /home/user/webRTC/trunk)
gyp: /home/user/webRTC/trunk/chrome/chrome.gyp not found (cwd: /home/user/webRTC/trunk)
gyp: /home/user/webRTC/trunk/android_webview/android_webview.gyp not found (cwd: /home/user/webRTC/trunk)
gyp: /home/user/webRTC/trunk/mojo/mojo.gyp not found (cwd: /home/user/webRTC/trunk)
gyp: /home/user/webRTC/trunk/content/content_shell_and_tests.gyp not found (cwd: /home/user/webRTC/trunk)
gyp: /home/user/webRTC/trunk/ui/ui_unittests.gyp not found (cwd: /home/user/webRTC/trunk)
gyp: /home/user/webRTC/trunk/webkit/renderer/compositor_bindings/compositor_bindings_tests.gyp not found (cwd: /home/user/webRTC/trunk)
gyp: /home/user/webRTC/trunk/cc/cc_tests.gyp not found (cwd: /home/user/webRTC/trunk)
gyp: /home/user/webRTC/trunk/third_party/WebKit/public/all.gyp not found (cwd: /home/user/webRTC/trunk)

构建和安装演示应用:

$ ninja -C out/Debug video_demo_apk
ninja: Entering directory 'out/Debug'
ninja: error: unknown target 'AppRTCDemo'

如果我有任何步骤错误,请告诉我。 我认为 android_gyp 有问题,但不要。

注意:我在我的 Windows 操作系统上使用 Ubuntu(VMware)

【问题讨论】:

这个问题你解决了吗?我也有同样的问题 可能有点晚了,但希望该教程对您有很大帮助。访问参考:WebRtc_Library_Compilation 【参考方案1】:

这是我在 Ubuntu 12.04.4 上构建 AppRTCDemo 的笔记,显然您的目录可能略有不同。

## building webrtc

# install dependencies:
sudo apt-get install git git-svn subversion g++ python libnss3-dev libasound2-dev libpulse-dev libjpeg62-dev libxv-dev libgtk2.0-dev libexpat1-dev lib32asound2-dev ia32-libs

# create a working directory:
mkdir -p ~/git/working

cd ~/git/working

# get the depottools:
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git

# Add depot_tools to your PATH:
echo "PATH=\$PATH:$HOME/git/working/depot_tools" >> ~/.bash_aliases
echo "export PATH" >> ~/.bash_aliases
. ~/.bash_aliases

# get the WebRTC source:
gclient config http://webrtc.googlecode.com/svn/trunk

# configure for android:
echo "target_os = ['android', 'unix']" >> .gclient

# synchronize:
gclient sync --nohooks

# set up env variables:
source ~/git/working/trunk/build/android/envsetup.sh

# install new dependencies:
sudo ~/git/working/trunk/build/./install-build-deps-android.sh
sudo ~/git/working/trunk/build/./install-build-deps.sh

# Set up webrtc-related GYP variables:
export GYP_DEFINES="build_with_libjingle=1 build_with_chromium=0 libjingle_java=1 $GYP_DEFINES"

# generate the build scripts:
gclient runhooks

# install find_depot_tools dummy file:
wget -O ~/git/working/trunk/build/find_depot_tools.py http://webrtc.googlecode.com/svn/trunk/webrtc/build/find_depot_tools.py

# build the Debug version of the AppRTCDemo:
ninja -C out/Debug AppRTCDemo

【讨论】:

您发布了一些 32 位的软件包,这些软件包是干什么用的?如果用户是 Ubuntu 64 位用户,他应该安装相同的软件包吗?如果没有,请在此处发表评论。 2014-05-05 19:08:44 ERROR 404: Not Found. - ninja -C 之前的最后一行失败了 url 文件 find_depot_tools.py 丢失,因此它无法正常工作,您可以更新一下吗? 使用这里的文件:github.com/adobe/chromium/blob/master/tools/find_depot_tools.py,然后再次尝试ninja -C trunk/out/Debug AppRTCDemo,但仍然失败,说:ninja error: unknown target 'AppRTCDemo' 进入主干文件夹;在 ninja build 命令之前运行“webrtc/build/gyp_webrtc”。如果 AppRTCDemo 仍然未知,只需运行“ninja -C out/Debug”。 原find_depot_tools.py可以在这里找到:code.google.com/p/webrtc/source/browse/trunk/webrtc/build/…这个解决方案很好用,谢谢【参考方案2】:

我在 Mac 上遇到了同样的 ninja: error: unknown target 'AppRTCDemo' 错误。为了解决这个错误,我必须指定一个有效的演示应用程序。对于 ios,它是 AppRTCMobile 而不是文档中所述的 AppRTCDemo

ninja -C out/Debug-sim32 AppRTCMobile

gclient 结帐中存在 RTC Mobile 演示:src/webrtc/examples/objc

https://chromium.googlesource.com/external/webrtc/+/master/webrtc/examples/objc/AppRTCMobile/

【讨论】:

以上是关于WebRTC:忍者构建不起作用的主要内容,如果未能解决你的问题,请参考以下文章

使用 webrtc 时 ReplayKit 不起作用

(webrtc) setRemoteDescription 对发起者不起作用

Flutter - webRTC 视频通话信号不起作用

忍者和 npm_executable-notfound

为啥“onecandidate”不起作用?

使用 CGPathAddArcToPoint 构建路径的 CAKeyframeAnimation 不起作用