Skip to content

Snappy1

  • Home
  • Android
  • What
  • How
  • Is
  • Can
  • Does
  • Do
  • Why
  • Are
  • Who
  • Toggle search form

[FIXED] python – Error while building WebRTC for android on Ubuntu

Posted on November 11, 2022 By

Solution 1 :

I was stuck with the same issues. While working on the following commands make sure you’re using the same(only-1) tab of Linux terminal for WebRTC Native Development.

Please visit this article which is quite helpful for webrtc native
development as well as the compilation of webrtc native stack: Compilation of WebRtc Library for Android

First of all, make sure of the following things that you have already installed, if not then use these commands to do that:

 - sudo add-apt-repository ppa:openjdk-r/ppa
 - sudo apt-get install openjdk-8-jdk
 - sudo apt-get install pkg-config
 - sudo apt-get update

After that, start the following steps one by one. Every step takes its own time based on the machine specs and internet speed, so make sure every step is completed without interruption.

1- git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git

2- export PATH="$PATH:${HOME}/depot_tools"

3- mkdir webrtc_android

3.1- cd webrtc_android

4- fetch --nohooks webrtc_android
    
5- gclient sync

6- cd src/

7- ./build/install-build-deps.sh

8- git branch -r

9- git checkout origin/master

# To check you're in origin/master branch
10- git branch

11- tools_webrtc/android/build_aar.py

It turns out that you will end up with the compilation and building of libwebrtc.aar in the webrtc_android/src/ directory.

Now, If you have already completed your task to step-7 with the branch-heads/m79, then
select the branch of origin/master instead of m79. To do that try the following steps:

Make sure you’re in this directory webrtc_android/src/:

 - git checkout origin/master
 # To make sure you're using origin/master
 - git branch
 - gclient revert
 - gclient sync
 - tools_webrtc/android/build_aar.py

And hopefully, you will have your issues sorted. Currently, You are checking out a branch that is behind the origin/master and doesn’t have all dependencies and modules over there which are necessary to build your libwebrtc.aar.


Now, if you tried these both procedures to build the WebRTC such as:

READ  [FIXED] android - how to keep button disable any editText Empty?
Powered by Inline Related Posts

1- Using AAR Build Tools (./tools_webrtc/android/build_aar.py)

2- Using Manual Compilation (gn gen out/Debug --args='target_os="android" target_cpu="arm"')

2.1- Compiling (ninja -C out/Debug)

Both procedures will work.


Solution 2 :

It can take a few attempts but running gclient sync a few times worked for me.

It can take a very long time to get all of the files and if it is interrupted it won’t retrieve them.

Problem :

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?

READ  [FIXED] android - Deal with dynamic response in retrofit
Powered by Inline Related Posts

Comments

Comment posted by Tristan Warren

I’ve had a similar problem, running ‘gclient sync’ and letting it complete (took me about 50 minutes and a few attempts) solved this error. However I now have a different error so if you get this far please let me know 🙂

Comment posted by compilation_of_webRtc_Library

Please visit this article which is quite helpful for webrtc native development as well as compilation of webrtc native stack.

Android Tags:android, python, webrtc, webrtc-android

Post navigation

Previous Post: [FIXED] android – How to pass data by Back Button, Kotlin
Next Post: [FIXED] Project with external module issue in android studio 3.6

Related Posts

[FIXED] Android Studio WebView only displaying white screen Android
[FIXED] android – Touch Listener interferes with RecyclerView Scrolling Android
[FIXED] c# – different patterns in one ListView Android
[FIXED] xamarin.forms – BindingMode=TwoWay in codebehind Android
[FIXED] how to retrofit and room handle nested object Android
[FIXED] android – Button in dialog always return null in onStart() in a Fragment Android

Archives

  • March 2023
  • February 2023
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022

Categories

  • ¿Cómo
  • ¿Cuál
  • ¿Cuándo
  • ¿Cuántas
  • ¿Cuánto
  • ¿Qué
  • Android
  • Are
  • At
  • C'est
  • Can
  • Comment
  • Did
  • Do
  • Does
  • Est-ce
  • Est-il
  • For
  • Has
  • Hat
  • How
  • In
  • Is
  • Ist
  • Kann
  • Où
  • Pourquoi
  • Quand
  • Quel
  • Quelle
  • Quelles
  • Quels
  • Qui
  • Should
  • Sind
  • Sollte
  • Uncategorized
  • Wann
  • Warum
  • Was
  • Welche
  • Welchen
  • Welcher
  • Welches
  • Were
  • What
  • What's
  • When
  • Where
  • Which
  • Who
  • Who's
  • Why
  • Wie
  • Will
  • Wird
  • Wo
  • Woher
  • you can create a selvedge edge: You can make the edges of garter stitch more smooth by slipping the first stitch of every row.2022-02-04
  • you really only need to know two patterns: garter stitch

Recent Posts

  • What color are dead flea eggs?
  • What is Indiana vine?
  • What’s the downside of a Chromebook?
  • Is phosphide the same as phosphorus?
  • Why do you need an S bend?

Recent Comments

No comments to show.

Copyright © 2023 Snappy1.

Powered by PressBook Grid Dark theme