PeerConnectionFactory(options) on Android is crashing

1,659 views
Skip to first unread message

samfast

unread,
Mar 28, 2017, 12:26:41 PM3/28/17
to discuss-webrtc
Hello,

I compiled the webrtc for android (version : 16518) and upgraded my application to use new version. However, when I try to create object of PeerConnectionFactory, I get following error and app crashes. 

E/rtc: #
       
# Fatal error in ../../webrtc/modules/utility/source/jvm_android.cc, line 236
       
# last system error: 0
       
# Check failed: g_jvm
       
#
       
#

This is how I am trying to do this:

PeerConnectionFactory.initializeAndroidGlobals(getApplicationContext(), false, false,
 
false);

PeerConnectionFactory.Options options = new PeerConnectionFactory.Options();

factory
= new PeerConnectionFactory(options);

I am trying to create peer connection for datachannel only, therefore, I have set other parameters to false in initializeAndroidGlobals().

When I compiled, I got so files for following architectures:
  • arm64-v8a
  • armeabi-v7a
  • x86
  • x86_64
I got the following two jar files:
  • base_java.jar
  • libjingle_peerconnection.jar
I have tried many things but couldn't resolve this error.

Previously, I used version 8871.

Thanks.

Henrik Andreasson

unread,
Mar 28, 2017, 12:33:01 PM3/28/17
to discuss-webrtc
Does it work if you call PeerConnectionFactory.initializeAndroidGlobals(getApplicationContext(), true, true, true) instead?

My guess is that your app needs to be able to initialize audio and video as well.

--

---
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/414ab22a-6a5b-4c02-9025-2dece24db05d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

samfast

unread,
Mar 28, 2017, 1:29:48 PM3/28/17
to discuss-webrtc
Thanks for reply Henrik.

When I send all variables as true, I get error in another file. Here is the error that I get:

E/rtc: #
         # Fatal error in ../../webrtc/modules/utility/source/helpers_android.cc, line 68
         # last system error: 2
         # Check failed: !jni->ExceptionCheck()
         # Error during FindClass: org/webrtc/voiceengine/BuildInfo
         #

I am still experimenting with the code. I have also added following lines in my code:


PeerConnectionFactory.initializeFieldTrials("Test");
PeerConnectionFactory.initializeInternalTracer();
PeerConnectionFactory.initializeAndroidGlobals(getApplicationContext(), true, true,
 
true);
PeerConnectionFactory.shutdownInternalTracer();


PeerConnectionFactory.Options options = new PeerConnectionFactory.Options();

factory
= new PeerConnectionFactory(options);

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

Taylor Brandstetter

unread,
Mar 28, 2017, 2:51:01 PM3/28/17
to discuss-webrtc
The latest error (missing org/webrtc/voiceengine/BuildInfo) was brought up in this thread: https://groups.google.com/forum/#!msg/discuss-webrtc/PkfAVr_TYQs/sndUN60VCQAJ;context-place=forum/discuss-webrtc

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/5ec6b963-7d08-413a-80be-df60ba62c774%40googlegroups.com.

Sojharo Mangi

unread,
Mar 29, 2017, 12:55:00 AM3/29/17
to discuss-webrtc
I have just read the other thread. I also compiled library using the automated script pristine.io. Should I rebuild the library? If pristine is outdated, is there any other set of instructions which are complete and also tell what are the required jars that we need to make. The instructions on webrtc.org are not in order so it is very difficult to follow them. Please guide.

--

---
You received this message because you are subscribed to a topic in the Google Groups "discuss-webrtc" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/discuss-webrtc/q9WD2PDAVwY/unsubscribe.
To unsubscribe from this group and all its topics, 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/CAK35n0aSk_LnPS3a3r7jvNgJn1zyrqRgF%2BSYfkDGJCfWhYyQxw%40mail.gmail.com.

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



--
Regards,
 
Sojharo


Arun Pandiyan

unread,
Apr 27, 2017, 9:30:32 AM4/27/17
to discuss-webrtc

If u built the webrtc from latest branch you should see a jar file named "audio_device_java.jar", import that jar, the error will be cleared! 

r66ms...@gmail.com

unread,
Aug 28, 2017, 4:39:15 AM8/28/17
to discuss-webrtc
check this post . i had the same issue
Reply all
Reply to author
Forward
0 new messages