我正试图在Ubuntu 16.04上为Android构建WebRTC。我已遵循以下步骤: https://medium.com/@abdularis/how-to-compile-native-webrtc-from-source-for-android-d0bac8e4c933(我在其他链接中也发现了类似的步骤)
我检查了版本:分支机构负责人/m79
使用命令生成代码时,我遇到以下错误:
python tools_webrtc/android/build_aar.py
ERROR at //build/config/android/internal_rules.gni:3051:7: Assertion failed.
assert(_is_annotation_processor || _is_java_binary || _has_sources)
^-----
See //build/config/android/rules.gni:1489:5: whence it was called.
java_library_impl(target_name) {
^-------------------------------
See //build/config/android/rules.gni:1844:5: whence it was called.
java_library(target_name) {
^--------------------------
See //webrtc.gni:850:5: whence it was called.
android_library(target_name) {
^-----------------------------
See //rtc_base/BUILD.gn:1359:3: whence it was called.
rtc_android_library("base_java") {
^---------------------------------
See //BUILD.gn:423:7: which caused the file to be included.
"rtc_base",
^---------
Traceback (most recent call last):
File "build_aar.py", line 234, in <module>
sys.exit(main())
File "build_aar.py", line 230, in main
args.build_dir, args.extra_gn_switches, args.extra_ninja_switches)
File "build_aar.py", line 210, in BuildAar
extra_ninja_switches)
File "build_aar.py", line 166, in Build
_RunGN(gn_args_list)
File "build_aar.py", line 93, in _RunGN
subprocess.check_call(cmd)
File "/usr/lib/python2.7/subprocess.py", line 541, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/usr/bin/python', '/home/architsinha/work/WebRTC_Android/src/third_party/depot_tools/gn.py', 'gen', '/tmp/tmpuxZSnM/armeabi-v7a', '--args=arm_version=7 use_goma=false target_cpu="arm" is_component_build=false is_debug=false rtc_include_tests=false target_os="android"']' returned non-zero exit status 1
如果我通过运行命令尝试其他方法
gn gen out/Debug --args='target_os="android" target_cpu="arm"'
我得到以下错误:
ERROR at //BUILD.gn:648:20: Assignment had no effect.
java_files = [
^
You set the variable "java_files" here and it was unused before it went
out of scope.
See //BUILD.gn:647:5: whence it was called.
junit_binary("android_junit_tests") {
^------------------------------------
如何修复此错误?有什么我错过的步骤吗
我也遇到了同样的问题。在处理以下命令时,请确保使用与WebRTC本机开发相同的(
only-1
)选项卡首先,请确保您已经安装了以下内容,如果没有,请使用以下命令执行此操作:
然后,依次开始以下步骤。根据机器规格和互联网速度,每一步都有自己的时间,因此确保每一步都不间断地完成
最后,您将在
webrtc_android/src/
目录中编译和构建libwebrtc.aar
现在,如果您已经用
branch-heads/m79
完成了step-7
的任务,那么选择
origin/master
的branch
而不是m79
。为此,请尝试以下步骤:确保您位于以下目录
webrtc_android/src/
:希望你能解决你的问题。当前,您正在签出位于
origin/master
后面的分支,该分支没有构建libwebrtc.aar
所需的所有依赖项和模块现在,如果您尝试使用这两个过程来构建WebRTC,例如:
1-使用AAR构建工具(
./tools_webrtc/android/build_aar.py
)2-使用手动编译(
gn gen out/Debug args='target_os="android" target_cpu="arm"'
)2.1-编译(
ninja -C out/Debug
)这两个程序都会奏效
它可能需要几次尝试,但运行几次
gclient sync
对我来说很有效获取所有文件可能需要很长时间,如果文件被中断,它将无法检索这些文件
相关问题 更多 >
编程相关推荐