Android: webrtc dependencies set

1,637 views
Skip to first unread message

Andrey Grusha

unread,
Oct 7, 2016, 11:04:48 AM10/7/16
to discuss-webrtc
Hey everyone! 
I am android developer and for my webrtc-based app I usually needed just two file dependencies: libjingle_peerconnection.jar and libjingle_peerconnection_so.so. Recently I decided to update my webrtc dependencies and found out that old good libjingle_peerconnection libraries are not enough anymore, as my application started to crash with messages like:

 Process: xxx, PID: 26181
        java.lang.UnsatisfiedLinkError: dlopen failed: library "libprotobuf_lite.cr.so" not found
                        at java.lang.Runtime.loadLibrary0(Runtime.java:977)
                        at java.lang.System.loadLibrary(System.java:1530)
                        at org.webrtc.PeerConnectionFactory.<clinit>(PeerConnectionFactory.java:21)
                        at org.webrtc.PeerConnectionFactory.initializeAndroidGlobals(Native Method)

Process: xxx, PID: 30677
       java.lang.UnsatisfiedLinkError: dlopen failed: library "libboringssl.cr.so" not found
                       at java.lang.Runtime.loadLibrary0(Runtime.java:977)
                       at java.lang.System.loadLibrary(System.java:1530)
                       at org.webrtc.PeerConnectionFactory.<clinit>(PeerConnectionFactory.java:21)
                       at org.webrtc.PeerConnectionFactory.initializeAndroidGlobals(Native Method)

Process: xxx, PID: 31461
      java.lang.NoClassDefFoundError: Failed resolution of: Lorg/webrtc/Logging;
                      at org.webrtc.EglBase14.isEGL14Supported(EglBase14.java:40)
                      at org.webrtc.EglBase.create(EglBase.java:86)
                      at org.webrtc.EglBase.create(EglBase.java:93)

and so on...

Could anyone share entire list of dependencies that I should provide nowadays to my Android app to work properly?

Christoffer Jansson

unread,
Oct 10, 2016, 7:05:38 PM10/10/16
to discuss-webrtc
Hi,

Maybe looking at the AppRTCMobile GN build config can be of some help?

/Chris

--



---

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/f82658e6-f935-47e3-9803-217b24aa08a1%40googlegroups.com.

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

--
/Chris

Kushtrim Pacaj

unread,
Oct 12, 2016, 10:58:30 AM10/12/16
to discuss-webrtc
You need them if you compile in debug mode.
Compile in release mode by passing is_debug=false in ninja args, and you'll only need libjingle_peerconnection_so.so 

Andrey Grusha

unread,
Oct 19, 2016, 9:19:08 AM10/19/16
to discuss-webrtc
I'm not sure if this flag is supported properly for Android builds. When I tried this

vagrant@precise64:/vagrant/webrtc/src$ gn gen out/Default --args='target_os="android" target_cpu="arm" is_debug=false'

All I got was:

ERROR at //build/config/compiler/compiler.gni:105:1: Assertion failed.
assert(ignore_elf32_limitations || !is_android || android_64bit_target_cpu ||
^-----
Android 32-bit non-component, non-clang builds cannot have symbol_level=2 due to 4GiB file size limit, see https://crbug.com/648948
See //build/toolchain/concurrent_links.gni:10:1: whence it was imported.
import("//build/config/compiler/compiler.gni")
^--------------------------------------------
See //build/toolchain/BUILD.gn:5:1: whence it was imported.
import("//build/toolchain/concurrent_links.gni")
^----------------------------------------------
See //build/toolchain/gcc_toolchain.gni:296:5: which caused the file to be included.
    tool("solink") {
    ^---------------

пятница, 7 октября 2016 г., 18:04:48 UTC+3 пользователь Andrey Grusha написал:

Akshay Shah

unread,
Oct 19, 2016, 12:45:11 PM10/19/16
to discuss-webrtc
I too got the same error. Temporarily resolved it with
is_component_build=true.

But it still did not lead to build success. I then faced the error mentioned at https://groups.google.com/forum/#!topic/discuss-webrtc/01uXPUQewCs

Kushtrim Pacaj

unread,
Oct 19, 2016, 4:49:20 PM10/19/16
to discuss-webrtc
Wierdly for me this worked:

echo "Compiling arm release"

gn gen out/arm  --args='target_os="android" target_cpu="arm" is_debug=false'

ninja -C out/arm

Henrik Kjellander

unread,
Oct 20, 2016, 8:40:06 AM10/20/16
to discuss-webrtc
On Wed, Oct 19, 2016 at 3:19 PM, Andrey Grusha <andrew...@gmail.com> wrote:
I'm not sure if this flag is supported properly for Android builds. When I tried this

vagrant@precise64:/vagrant/webrtc/src$ gn gen out/Default --args='target_os="android" target_cpu="arm" is_debug=false'

All I got was:

ERROR at //build/config/compiler/compiler.gni:105:1: Assertion failed.
assert(ignore_elf32_limitations || !is_android || android_64bit_target_cpu ||
^-----
Android 32-bit non-component, non-clang builds cannot have symbol_level=2 due to 4GiB file size limit, see https://crbug.com/648948
See //build/toolchain/concurrent_links.gni:10:1: whence it was imported.
import("//build/config/compiler/compiler.gni")
^--------------------------------------------
See //build/toolchain/BUILD.gn:5:1: whence it was imported.
import("//build/toolchain/concurrent_links.gni")
^----------------------------------------------
See //build/toolchain/gcc_toolchain.gni:296:5: which caused the file to be included.
    tool("solink") {
    ^---------------

As the error message says, you'll have to pass symbol_level=1 for Android 32 bit builds these days. The message is pretty clear.
To be sure what works, you can always check the generate_build_files steps at builds for our bots at https://build.chromium.org/p/client.webrtc/waterfall

 
пятница, 7 октября 2016 г., 18:04:48 UTC+3 пользователь Andrey Grusha написал:
Hey everyone! 
I am android developer and for my webrtc-based app I usually needed just two file dependencies: libjingle_peerconnection.jar and libjingle_peerconnection_so.so. Recently I decided to update my webrtc dependencies and found out that old good libjingle_peerconnection libraries are not enough anymore, as my application started to crash with messages like:

 Process: xxx, PID: 26181
        java.lang.UnsatisfiedLinkError: dlopen failed: library "libprotobuf_lite.cr.so" not found
                        at java.lang.Runtime.loadLibrary0(Runtime.java:977)
                        at java.lang.System.loadLibrary(System.java:1530)
                        at org.webrtc.PeerConnectionFactory.<clinit>(PeerConnectionFactory.java:21)
                        at org.webrtc.PeerConnectionFactory.initializeAndroidGlobals(Native Method)

Process: xxx, PID: 30677
       java.lang.UnsatisfiedLinkError: dlopen failed: library "libboringssl.cr.so" not found
                       at java.lang.Runtime.loadLibrary0(Runtime.java:977)
                       at java.lang.System.loadLibrary(System.java:1530)
                       at org.webrtc.PeerConnectionFactory.<clinit>(PeerConnectionFactory.java:21)
                       at org.webrtc.PeerConnectionFactory.initializeAndroidGlobals(Native Method)

Process: xxx, PID: 31461
      java.lang.NoClassDefFoundError: Failed resolution of: Lorg/webrtc/Logging;
                      at org.webrtc.EglBase14.isEGL14Supported(EglBase14.java:40)
                      at org.webrtc.EglBase.create(EglBase.java:86)
                      at org.webrtc.EglBase.create(EglBase.java:93)

and so on...

Could anyone share entire list of dependencies that I should provide nowadays to my Android app to work properly?

--

---
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/40d65d59-9cb8-47ba-834c-4f2eaa3bbf8d%40googlegroups.com.

xiang liu

unread,
Oct 23, 2016, 12:00:01 AM10/23/16
to discuss-webrtc
does not work for me

在 2016年10月20日星期四 UTC+8上午4:49:20,Kushtrim Pacaj写道:

xiang liu

unread,
Oct 23, 2016, 12:01:01 AM10/23/16
to discuss-webrtc


在 2016年10月20日星期四 UTC+8下午8:40:06,Henrik Kjellander写道:
On Wed, Oct 19, 2016 at 3:19 PM, Andrey Grusha <andrew...@gmail.com> wrote:
I'm not sure if this flag is supported properly for Android builds. When I tried this

vagrant@precise64:/vagrant/webrtc/src$ gn gen out/Default --args='target_os="android" target_cpu="arm" is_debug=false'

All I got was:

ERROR at //build/config/compiler/compiler.gni:105:1: Assertion failed.
assert(ignore_elf32_limitations || !is_android || android_64bit_target_cpu ||
^-----
Android 32-bit non-component, non-clang builds cannot have symbol_level=2 due to 4GiB file size limit, see https://crbug.com/648948
See //build/toolchain/concurrent_links.gni:10:1: whence it was imported.
import("//build/config/compiler/compiler.gni")
^--------------------------------------------
See //build/toolchain/BUILD.gn:5:1: whence it was imported.
import("//build/toolchain/concurrent_links.gni")
^----------------------------------------------
See //build/toolchain/gcc_toolchain.gni:296:5: which caused the file to be included.
    tool("solink") {
    ^---------------

As the error message says, you'll have to pass symbol_level=1 for Android 32 bit builds these days. The message is pretty clear.
To be sure what works, you can always check the generate_build_files steps at builds for our bots at https://build.chromium.org/p/client.webrtc/waterfall



i  have tried that, still does not work.
 
 
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.

Henrik Kjellander

unread,
Oct 24, 2016, 7:46:17 AM10/24/16
to discuss-webrtc
On Sun, Oct 23, 2016 at 6:01 AM, xiang liu <leeo...@gmail.com> wrote:

在 2016年10月20日星期四 UTC+8下午8:40:06,Henrik Kjellander写道:
On Wed, Oct 19, 2016 at 3:19 PM, Andrey Grusha <andrew...@gmail.com> wrote:
I'm not sure if this flag is supported properly for Android builds. When I tried this

vagrant@precise64:/vagrant/webrtc/src$ gn gen out/Default --args='target_os="android" target_cpu="arm" is_debug=false'

All I got was:

ERROR at //build/config/compiler/compiler.gni:105:1: Assertion failed.
assert(ignore_elf32_limitations || !is_android || android_64bit_target_cpu ||
^-----
Android 32-bit non-component, non-clang builds cannot have symbol_level=2 due to 4GiB file size limit, see https://crbug.com/648948
See //build/toolchain/concurrent_links.gni:10:1: whence it was imported.
import("//build/config/compiler/compiler.gni")
^--------------------------------------------
See //build/toolchain/BUILD.gn:5:1: whence it was imported.
import("//build/toolchain/concurrent_links.gni")
^----------------------------------------------
See //build/toolchain/gcc_toolchain.gni:296:5: which caused the file to be included.
    tool("solink") {
    ^---------------

As the error message says, you'll have to pass symbol_level=1 for Android 32 bit builds these days. The message is pretty clear.
To be sure what works, you can always check the generate_build_files steps at builds for our bots at https://build.chromium.org/p/client.webrtc/waterfall



i  have tried that, still does not work.

You must be doing something else wrong then. Please provide a full set of commands what you run and the resulting error message.
This run on one of our bots tells me it's working (I did the changes to the bot configs myself): https://build.chromium.org/p/client.webrtc/builders/Android32%20%28M%20Nexus5X%29/builds/128/steps/generate_build_files/logs/stdio

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/9565793c-2be3-4e61-9a55-a3e8c513c0e3%40googlegroups.com.

Henrik Kjellander

unread,
Oct 24, 2016, 8:17:56 AM10/24/16
to discuss-webrtc
See https://bugs.chromium.org/p/chromium/issues/detail?id=648948 for more context.
I'm working on a better solution for WebRTC, since we shouldn't be affected by this size limit, we're just using the same toolchain.

Until then, you'll have to pass symbol_level=1 to GN args for 32-bit Android release builds.
See our bot's generate_build_files steps for examples that are proven to be working: https://build.chromium.org/p/client.webrtc/builders/Android32%20%28M%20Nexus5X%29/

xiang liu

unread,
Oct 24, 2016, 8:30:50 AM10/24/16
to discuss-webrtc

symbol_level=1 set to  32bit  android can not work.

the audio_module build  fails.



在 2016年10月24日星期一 UTC+8下午8:17:56,Henrik Kjellander写道:


Henrik Kjellander

unread,
Oct 24, 2016, 9:16:42 AM10/24/16
to discuss-webrtc
Like I said before, please provide full command lines and error message.

I've filed https://bugs.chromium.org/p/webrtc/issues/detail?id=6596 to track fixing this in a nicer way than the current workaround.

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/2ec14288-9352-44af-b692-e5d0ec593b11%40googlegroups.com.

Marcus Larsson

unread,
Oct 25, 2016, 4:56:10 AM10/25/16
to discuss-webrtc
I used the following command: 
gn gen out/arm --args='target_os="android" target_cpu="arm" is_debug=false dcheck_always_on=true symbol_level=1 is_component_build=false' 

Compiled without any errors.

Lars Bork

unread,
Dec 13, 2016, 11:30:43 AM12/13/16
to discuss-webrtc
I am also getting quite a similar error when trying ti initialize a PeerConnectionFactory:

W/System.err: java.lang.NoClassDefFoundError: Failed resolution of: Lorg/webrtc/Logging;
W/System.err:     at org.webrtc.voiceengine.WebRtcAudioManager.<init>(WebRtcAudioManager.java:142)

Do you have any idea what I am doing wrong? My app works fine until I call a single method of WebRtc.

Moshe Katz

unread,
Dec 14, 2016, 3:08:51 AM12/14/16
to discuss-webrtc
I believe that this is a different issue than the one being described here.

Your issue is that you are missing the new base_java.jar that is required in addition to libjingle_peerconnection_java.jar.
For some reason, the Java code is now split between these JARs instead of being in a single one.

At the moment, only three classes have been moved to the new JAR:
  • org.webrtc.Logging
  • org.webrtc.Size
  • org.webrtc.ThreadUtils


Moshe

Lars Bork

unread,
Dec 14, 2016, 5:03:16 AM12/14/16
to discuss-webrtc
Yes, that fixed my problem! Thank you very much for your help. 

Have a great day!
Reply all
Reply to author
Forward
0 new messages