I am trying to build WebRTC for Android on Ubuntu 16.04. I have followed the steps mentioned at: https://medium.com/@abdularis/how-to-compile-native-webrtc-from-source-for-android-d0bac8e4c933 ( I found similar steps in the other links also)
I checked out the version: branch-heads/m79
I am getting the following error while building the code with the command:
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
If I try the other method by running the command
gn gen out/Debug --args='target_os="android" target_cpu="arm"'
I get the following error:
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") {
^------------------------------------
How can I fix this error? Is there some step which I have missed?