Some files are not generating - Native WebRTC Build Cross Compilation

110 views
Skip to first unread message

Chandramouli P

unread,
May 2, 2018, 8:10:39 AM5/2/18
to discuss-webrtc
Hello,

I am trying to build native WebRTC library for different platforms. I am able to build successfully. But, some files are generating and some files are not generating. I tried this on a fresh Ubuntu installed system without installing anything, except updates and build-essentials. Please go through the below steps that I followed. 

Note: I am giving each and every step as documentation and might useful to new users as future reference.

Operating System: Ubuntu 16.04 (64 Bit) Desktop Edition

Steps:

Setting up OpenJDK:
1) sudo add-apt-repository ppa:openjdk-r/ppa
2) sudo apt-get update
3) sudo apt-get install openjdk-8-jdk
4) sudo update-alternatives --config java (Copy the path)
5) sudo update-alternatives --config javac
6) sudo update-alternatives --config javap
7) sudo update-alternatives --config jar
8) sudo update-alternatives --config jarsigner
9) sudo update-alternatives --config javaws
10) java -version
11) sudo nano /etc/environment
JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64/"
12) source /etc/environment
13) echo $JAVA_HOME
14) readlink -f $(which java)

Build Native WebRTC Framework:
15) cd $HOME/Desktop/cm
16) mkdir nativertc
17) cd nativertc
19) cd depot_tools
20) sudo nano ~/.profile
(Add the below line at end of the file)
export PATH=$PATH:$HOME/Desktop/cm/nativertc/depot_tools
21) source ~/.profile
22) cd
23) mkdir ~/chromium
24) cd ~/chromium
25) fetch --nohooks --no-history android
26) cd src
27) build/install-build-deps-android.sh
28) gclient runhooks

Build Native WebRTC for Android (ARM CPU):
29) gn gen --args='target_os="android" target_cpu="arm" is_debug=false' out/arm
30) ninja -C out/arm

I haven't get any errors and successfully executed the above command. After completion of this execution, I checked the out/arm folder. In out/arm folder:

Below files are generating in out/arm folder:
libc++_shared.so

Below files are not generating:
libjingle_peerconnection_so.so
audio_device_java.jar
base_java.jar
libjingle_peerconnection.jar

Please suggest me what I am missing and solution.

Thanks in advance.

Regards,
Chandramouli.

Alexandre GOUAILLARD

unread,
May 2, 2018, 11:41:36 AM5/2/18
to discuss...@googlegroups.com
I think the step #25 should be "fetch [...] webrtc_android"

basically it looks like you mixed the chromium checkout and the webrtc standalone checkout.

if you look at the "fetch android" command:

depot_tools/fetch_configs/android.py


you will see that it s just an alias for the chromium fetch command, for android target:

def fetch_spec(props):

    return {

      'alias': {

        'config': 'chromium',

        'props': ['--target_os=android'],

      },

    }


--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrtc+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/22254ce1-5129-4b6e-a727-75b3c656f4a8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Alex. Gouaillard, PhD, PhD, MBA
------------------------------------------------------------------------------------
President - CoSMo Software Consulting, Singapore
------------------------------------------------------------------------------------

Chandramouli P

unread,
May 3, 2018, 3:01:41 AM5/3/18
to discuss...@googlegroups.com
Hello Alexandre,

Thank you for your reply. As you suggested, I will execute and "fetch --nohooks --no-history webrtc_android" and build. I will get back to you, once I am done.

Thank you, once again.

Regards,
Chandramouli.


Chandramouli P

unread,
May 7, 2018, 2:29:01 AM5/7/18
to discuss...@googlegroups.com
Hello Alexandre,

As you suggested, I executed "fetch --nohooks --no-history webrtc_android" and built the library with the below command for arm64 CPU:

gn gen --args='target_os="android" target_cpu="arm64" is_debug=false' out/Default
ninja -C out/Default

This time, "libjingle_peerconnection_so.so" file  only generated. No other files are generated. Do I need to install Android (SDK & NDK) also in my machine?

Thank you.

Regards,
Chandramouli.

Chandramouli P

unread,
May 8, 2018, 4:31:24 AM5/8/18
to discuss...@googlegroups.com
Hello Alexandre,

Any reply would be appreciated.

Thank you.

Regards,
Chandramouli.

yihungbakj hung

unread,
May 11, 2018, 5:11:37 AM5/11/18
to discuss-webrtc

I recommend you to try the WebRTC M62.

Chandramouli P於 2018年5月2日星期三 UTC+8下午8時10分39秒寫道:

chris...@anserinnovation.com

unread,
May 11, 2018, 10:32:11 AM5/11/18
to discuss-webrtc
I've had good luck using the python script that's included to build the aar library.  This bundles the arm, arm64, x86 and x86_64 libraries into one file.

$python ./tools_webrtc/android/build_aar.py  

Alexandre GOUAILLARD

unread,
May 11, 2018, 11:33:50 PM5/11/18
to discuss...@googlegroups.com
dear all,

if you follow the steps in webrtc.org it will work.

@chandra I told you you were using the wrong fetch recipe, which you rightfully connected. However, you still need to do a "gclient sync" after that, as indicated in the webrtc.org webpage under "get the source"

The first fetch launch "gclient config" and "gclient --nohook sync" for you (or something like that). Now you need to launch the hook to get the android SDKs and NDKs. Note that those are special versions of the SDKs / NDKs, as well as the complete toolchain. That means it is very unlikely that you would be able to find the correct one by yourself without using those automated steps. Moreover, the depot_tolls and other tools's revision are pinned to the webrtc commit, to be sure they are kept in sync. (*)

So if you forget that call to "gclient sync", you miss most of the toolchain and SDKs/NDKS.

why not following the webrtc.org page and copy paste the lines from there to your terminal?

regards,

Dr. Alex.

(*) once the first fetch command is done, you will have a copy of the source code that contains a DEPS file. Inside that file, you will see a "vars", "deps", and "hooks" sections. This will be used by the "gclient sync" command. You can conceptually see the "deps" as the equivalent of git submodules: they will create local subdirectory which are clones of git repositories at a given commit. hooks are scripts being executed under certain conditions. For example for the android SDK/NDK:

# This downloads SDK extras and puts them in the

    # third_party/android_tools/sdk/extras directory.

    'name': 'sdkextras',

    'pattern': '.',

    'condition': 'checkout_android',

    # When adding a new sdk extras package to download, add the package

    # directory and zip file to .gitignore in third_party/android_tools.

    'action': ['python',

               'src/build/android/play_services/update.py',

               'download'

    ],


recursedeps = [

  # buildtools provides clang_format, libc++, and libc++abi.

  'src/buildtools',

  # android_tools manages the NDK.

  'src/third_party/android_tools',

]



--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrtc+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Uttam Kadam

unread,
May 14, 2018, 3:45:13 AM5/14/18
to discuss...@googlegroups.com
Hi All,

Is WebRTC work on iOS safari browser?

Regards,
Uttam Kadam

To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.



--
Alex. Gouaillard, PhD, PhD, MBA
------------------------------------------------------------------------------------
President - CoSMo Software Consulting, Singapore
------------------------------------------------------------------------------------

--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/CAHgZEq7BSQ%2BXe0ZMvoJXj_3ot6H68t8K9mRs2eToqLEy74Jt1Q%40mail.gmail.com.

Chandramouli P

unread,
May 14, 2018, 4:25:21 AM5/14/18
to discuss-webrtc
Yes. It will work.

Chandramouli P

unread,
May 14, 2018, 7:55:27 AM5/14/18
to discuss-webrtc
Hello Chris,

As you suggested, I executed the Python file (Of course, I executed "gclient sync" as suggested by Dr. Alex). Again, some files are generating and some files are not generating. Please find the below updated steps that I followed and generated files:

Note: I am giving each and every step as documentation and might useful to new users as future reference.

Operating System: Ubuntu 16.04 (64 Bit) Desktop Edition (Fresh Installation with build-essential and apt-get upgrade)
Ref. URLs:
25) fetch --nohooks --no-history webrtc_android
26) cd src
27) gclient sync
28) gclient runhooks
29) build/install-build-deps-android.sh
30) build/install-build-deps.sh
31) sudo python ./tools_webrtc/android/build_aar.py --build-dir out/Default  

After completion of executing the above command i.e. Step. (31), Four folders (i.e. arm64-v8a, armeabi-v7a, x86, and x86_64) are generated in out/Default folder.

No .aar file is generated anywhere

Below files are generated:
libjingle_peerconnection_so.so
audio_device_java.jar
base_java.jar
libjingle_peerconnection.jar

Below files are not generating:


Please suggest me what I am missing and solution.

Thanks in advance.

Regards,
Chandramouli.


Chandramouli P

unread,
May 14, 2018, 7:55:58 AM5/14/18
to discuss-webrtc
Hello Dr. Alex,

Thank you very much for your detailed information. In fact, I followed https://webrtc.org/native-code/android/ link in the past only. As I haven't get the result, I started searching and depending on other sources. As you suggested, I executed "gclient sync" command and tried to built with the below commands as usual:

gn gen --args='target_os="android" target_cpu="arm64" is_debug=false' out/Default
ninja -C out/Default

But, only libjingle_peerconnection_so.so file is generated and no other files are generated.

Hence, request you to you advise me to fill the gap that is what and where I am missing.

Thanks in advance.

Regards,
Chandramouli.


To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.

Chandramouli P

unread,
May 22, 2018, 11:40:49 PM5/22/18
to discuss-webrtc
Hello,

Any help and update would be appreciated.

Thank you.

Regards,
Chandramouli.

Chandramouli P

unread,
May 22, 2018, 11:42:01 PM5/22/18
to discuss-webrtc
Hello Chris,

Any help and update would be appreciated.

Thank you.

Regards,
Chandramouli.

Chandramouli P

unread,
May 27, 2018, 11:53:34 PM5/27/18
to discuss-webrtc
Hello,

I am still waiting for your support. Any reply would be appreciated.

Thank you.

Regards,
Chandramouli.
Reply all
Reply to author
Forward
0 new messages