Unable to compile WebRTC for an android app. And I have the source code of WebRTC....

790 views
Skip to first unread message

Alex M

unread,
Jul 8, 2015, 5:41:06 AM7/8/15
to discuss...@googlegroups.com
I have an android application which uses WebRTC. It also uses gradle.

A few months ago it worked well, not it doesn't because some of the new classes from "import org.webrtc....." aren't found. Some are, however.

I've downloaded the source code of WebRTC and compiled it. And I put an so-file from

out/Debug/lib
 to 
my_app/app/src/main/jniLibs/x86_64/libjingle_peerconnection_so.so

but that didn't help.

What should I do to resolve those classes that aren't found? Should I import *.so files to my project? Or .jar? If yes, from and to which locations exactly?

Alex M

unread,
Jul 8, 2015, 5:43:38 AM7/8/15
to discuss...@googlegroups.com
The title should've been "Unable to compile a WebRTC Android application"

Christoffer Jansson

unread,
Jul 8, 2015, 6:23:13 AM7/8/15
to discuss...@googlegroups.com
You should include the out/Debug/libjingle_peerconnection.jar in addition to the *.so file. Make sure to grab the libjingle_peerconnection_so.so file from out/Debug/AppRTCDemo/libs/x86_64 (I guessed that's the architecture you want based on your project path for *.so files). 

On Wed, Jul 8, 2015 at 11:43 AM Alex M <gilded...@gmail.com> wrote:
The title should've been "Unable to compile a WebRTC Android application"

--

---
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/1567117e-0b43-45eb-9b6f-fce9fec38e52%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Alex M

unread,
Jul 9, 2015, 12:29:50 AM7/9/15
to discuss...@googlegroups.com
1) out/Debug/libjingle_peerconnection.jar - doesn't exist
2) out/Debug/AppRTCDemo/libs/x86_64 - this doesn't exist either for some reason

Alex M

unread,
Jul 9, 2015, 12:34:49 AM7/9/15
to discuss...@googlegroups.com
I have this:

$ find src/out/Debug -iname "*.jar"
src/out/Debug/gen/base_java/base_java.jar
src/out/Debug/gen/jsr_305_javalib/jsr_305_javalib.jar
src/out/Debug/gen/libjingle_peerconnection_java/libjingle_peerconnection_java.jar
src/out/Debug/lib.java/base_java.jar
src/out/Debug/lib.java/jsr_305_javalib.jar
src/out/Debug/lib.java/base_java.dex.jar
src/out/Debug/lib.java/libjingle_peerconnection_java.jar
src/out/Debug/lib.java/rezip_apk.jar
src/out/Debug/lib.java/chromium_apk_AppRTCDemo.jar
src/out/Debug/lib.java/libjingle_peerconnection_java.dex.jar
src/out/Debug/lib.java/jsr_305_javalib.dex.jar
src/out/Debug/AppRTCDemo/obfuscated.jar
src/out/Debug/AppRTCDemo/AppRTCDemo.javac.jar



On Wednesday, July 8, 2015 at 5:23:13 PM UTC+7, Christoffer Jansson wrote:

Alex M

unread,
Jul 9, 2015, 12:37:06 AM7/9/15
to discuss...@googlegroups.com
And this:

$ find src/out/Debug -iname "*.so"
src/out/Debug/lib/libjingle_peerconnection_so.so
src/out/Debug/AppRTCDemo/stripped_libraries/libjingle_peerconnection_so.so
src/out/Debug/AppRTCDemo/libs/armeabi-v7a/libjingle_peerconnection_so.so



On Wednesday, July 8, 2015 at 5:23:13 PM UTC+7, Christoffer Jansson wrote:

Christoffer Jansson

unread,
Jul 9, 2015, 4:31:21 AM7/9/15
to discuss...@googlegroups.com, gilded...@gmail.com
I see, turns out I've built for several architectures and they are kept in between builds.

If you want to get a x86_64 *.so lib for android you need to set "target_arch=x64" in your gyp defines. If you want 32 bit it's ia32, 64 bit arm is arm64 and omitting target_arch you get the standard 32 bit arm.

E.g:

export GYP_DEFINES="build_with_libjingle=1 build_with_chromium=0 libjingle_java=1 OS=android target_arch=x64"

gclient runhooks

ninja -C out/Debug

Do note that x86_64 for Android is not actively supported yet I think although it's built as part of Chromium, more details in this post.

Also you should have a libjingle_peerconnection.jar file in out/Debug/ if you run the commands above.

Alex M

unread,
Jul 9, 2015, 8:25:44 AM7/9/15
to discuss...@googlegroups.com, gilded...@gmail.com
Thanks.


>>If you want to get a x86_64 *.so lib for android you need to set "target_arch=x64" in your gyp defines. If you want 32 bit it's ia32, 64 bit arm is arm64 and omitting target_arch you get the standard 32 bit arm.
What I want is to just compile my android webrtc application. What should I use: x64? x32? something else?

Christoffer Jansson

unread,
Jul 9, 2015, 8:29:16 AM7/9/15
to discuss...@googlegroups.com, gilded...@gmail.com
If you have no preference omit the target-arch param in GYP_DEFINES and use the *.so file under AppRTCDemo/libs/armeabi-v7a.

Alex M

unread,
Jul 9, 2015, 8:40:46 AM7/9/15
to discuss...@googlegroups.com, gilded...@gmail.com
I did it and for some reason a couple of classes from webrtc weren't found again.

Alex M

unread,
Jul 9, 2015, 8:47:13 AM7/9/15
to discuss...@googlegroups.com, gilded...@gmail.com
And under which location is the source code for Android WebRTC? I just want to confirm I'm using the correct path.

Alex M

unread,
Jul 9, 2015, 8:51:39 AM7/9/15
to discuss...@googlegroups.com, gilded...@gmail.com
What's the location for .the jar file I need to copy to my webrtc android app?

Christoffer Jansson

unread,
Jul 9, 2015, 9:15:01 AM7/9/15
to discuss...@googlegroups.com, gilded...@gmail.com
Your build or project file should determine the location. I saw you wrote gradle, have you looked at the build.gradle file?

I'm sure you can figure it out by searching for something like "Add library/jar to my android project".

On Thu, Jul 9, 2015 at 2:51 PM Alex M <gilded...@gmail.com> wrote:
What's the location for .the jar file I need to copy to my webrtc android app?

--

---
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.

Alex M

unread,
Jul 9, 2015, 9:48:09 AM7/9/15
to discuss...@googlegroups.com, gilded...@gmail.com
I mean the location of the compiled jar file from the source code I've compiled. Not where to put, but from where.

Christoffer Jansson

unread,
Jul 9, 2015, 10:15:00 AM7/9/15
to discuss...@googlegroups.com, gilded...@gmail.com
As already mentioned, out/Debug/

Alex M

unread,
Jul 9, 2015, 12:12:19 PM7/9/15
to discuss...@googlegroups.com, gilded...@gmail.com
As I mentioned already, there's no jar file in out/Debug

Christoffer Jansson

unread,
Jul 9, 2015, 12:21:30 PM7/9/15
to discuss...@googlegroups.com, gilded...@gmail.com
Then your gyp defines is wrong.

Start from a clean slate, do the following in your src/ folder:

git checkout master
git pull
rm -rf out/Debug
export GYP_DEFINES="build_with_libjingle=1 build_with_chromium=0 libjingle_java=1 OS=android"
gclient runhooks
ninja -C out/Debug

Alex M

unread,
Jul 9, 2015, 9:15:52 PM7/9/15
to discuss...@googlegroups.com, gilded...@gmail.com
Please reread what I wrote about. There's no .jar files exactly in  out/Debug and can't be. The jar files are in subfolders of out/Debug. And my question is in which one?

Christoffer Jansson

unread,
Jul 10, 2015, 1:12:09 AM7/10/15
to discuss...@googlegroups.com, gilded...@gmail.com

Something is wrong with your checkout. Please try from a clean slate and redo all the steps for checking out and building webrtc for android, it should appear where I mentioned. You can just create a new checkout in a new folder and try again.

I cannot help you further since your checkout is in an unknown state not producing the files as it should when compiling.

/Chris


Shubendra Kumar

unread,
Jul 10, 2015, 2:56:14 AM7/10/15
to discuss...@googlegroups.com
I have compiled Webrtc code few days ago. I used https://github.com/pristineio/webrtc-build-scripts to compile.

Alex M

unread,
Jul 10, 2015, 4:29:47 AM7/10/15
to discuss...@googlegroups.com, gilded...@gmail.com
what's the full name, including the path, of the jar file?

Christoffer Jansson

unread,
Jul 10, 2015, 4:37:06 AM7/10/15
to discuss...@googlegroups.com, gilded...@gmail.com
src/out/Debug/libjingle_peerconnection.jar




Alex M

unread,
Jul 10, 2015, 5:01:04 AM7/10/15
to discuss...@googlegroups.com, gilded...@gmail.com
I have it in /src/out/Debug/gen/libjingle_peerconnection_java/libjingle_peerconnection.jar

How do you compile?

Henrik Andreasson

unread,
Jul 10, 2015, 5:05:19 AM7/10/15
to discuss...@googlegroups.com, gilded...@gmail.com
Alex, I think you have to start from scratch here since we can't add more support on this issue. My guess is that your compilation fails and you therefore lack the files you are asking for.
Please use the standard procedure and follow all steps exactly.


On Fri, Jul 10, 2015 at 11:01 AM, Alex M <gilded...@gmail.com> wrote:
I have it in /src/out/Debug/gen/libjingle_peerconnection_java/libjingle_peerconnection.jar

How do you compile?

--

---
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.

Alexander

unread,
Jul 28, 2015, 6:43:51 AM7/28/15
to discuss-webrtc, gilded...@gmail.com, hen...@webrtc.org
I also made an AppRTC application (followed steps on this guide: http://www.webrtc.org/native-code/android) and didn't get libjingle.jar in /src/out/Debug.
As Alex M wrote, it is placed in /src/out/Debug/gen/libjingle_peerconnection_java/libjingle_peerconnection.jar.
Reply all
Reply to author
Forward
Message has been deleted
0 new messages