Hello Again, sorry for the wait! Just thought I'd seperate the Android tutorial and the WebRTC Android build tutorial.
I tried using the prebuilt libraries from: https://webrtc.github.io/webrtc-org/native-code/android/
But that didn't work so I decided to build it from scratch. After trying for hours to build it on Arch Linux and failing I then found out you can only build Android on the following OS's:
ERROR: The only supported distros are Ubuntu 14.04 LTS (trusty with EoL April 2022) Ubuntu 16.04 LTS (xenial with EoL April 2024) Ubuntu 18.04 LTS (bionic with EoL April 2028) Ubuntu 20.04 LTS (focal with Eol April 2030) Ubuntu 20.10 (groovy) Debian 10 (buster) or later
Hopefully you don't make the same mistake I did. Hopefully the future me won't make the same mistake either! 😅
Here I will show you how to build the Android library from scratch, I will show how to implement it into your own project next part.
Well then let's build the native Android WebRTC Library! Don't forget to check the OS your building on! 🤧
First we need to get the tools needed to build the library, this can be done via the following:
mkdir webrtc && cd webrtc git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git export PATH=/path/to/depot_tools:$PATH
Here we get the tools required to build the android library(and ios) and set the path.
Next we need to get the WebRTC Android source and sync.
fetch --nohooks webrtc_android gclient sync
Once we have the source we can update to the latest source via the following:
cd src git checkout main git pull origin main gclient sync
As far as I'm aware sync must be done after and source updates.
Next we need to install the dependencies needed to build the libarary.
Finally build the WebRTC Android library. This part may take some time to complete so grab your favorite beverage and relax. 🍸
Once done you should see the "libwebrtc.aar" file in the src directory.
You can get the WebRTC Android library here: https://github.com/ethand91/android_libwebrtc
Feel free to use it. 😎
That concludes this small part, hopefully this is helpful to you.
Like me work? I post about a variety of topics, if you would like to see more please like and follow me. Also I love coffee. 😊