Re: Can't compile android webrtc example

1,790 views
Skip to first unread message

Sebastian Kummer

unread,
Apr 3, 2013, 11:00:37 AM4/3/13
to discuss...@googlegroups.com
you need "unix" too
 
target_os = ["android"]


Max Koshevoy

unread,
Apr 3, 2013, 4:25:10 PM4/3/13
to discuss...@googlegroups.com
I have linux 64 bit.

I was able to compile it. Thank You!

Maulik Prabhudesai

unread,
Apr 9, 2013, 6:49:27 AM4/9/13
to discuss...@googlegroups.com
I also have a similar question
I have a 32 bit linux machine and I am trying to build webrtc for android. 

I do the following things as mentioned on the WebRTC website. 
2. added target_os = ['android', 'unix'] to .gclient
3. gclient sync --force
4. source ./build/android/envsetup.sh --try-32bit-host
Defaulting GYP_GENERATORS to ninja
5. gclient runhooks
At this stage the build fails and I get the following error 
/home/maulikprabhudesai/webrtc/trunk/third_party/android_tools/ndk//toolchains/arm-linux-androideabi-4.6/prebuilt/linux-i686/bin/*-gcc: not found

gyp: Call to '/home/maulikprabhudesai/webrtc/trunk/third_party/android_tools/ndk//toolchains/arm-linux-androideabi-4.6/prebuilt/linux-i686/bin/*-gcc -print-libgcc-file-name' returned exit status 127. while trying to load trunk/talk/libjingle_all.gyp

Error: Command /usr/bin/python trunk/build/gyp_chromium --depth=trunk trunk/talk/libjingle_all.gyp -Dextra_gyp_flag=0 returned non-zero exit status 1 in /home/maulikprabhudesai/webrtc

I noticed that the directory /linux-i686/ does not exist and has the directory linux-x86 
Is there something else which has to be done  ? 


On Tuesday, 9 April 2013 11:58:30 UTC+2, Maulik Prabhudesai wrote:
A basic question, but from which directory do you run gclient runhooks ? 

On Saturday, 30 March 2013 16:11:57 UTC+1, Max Koshevoy wrote:
I have setup Prerequisite software. I was able to compile client and server but it fails to compile android version.

My host machine is Ubuntu 12.10 64bit
NDK r8c
Oracle Java 7

export ANDROID_SDK_ROOT=/home/user/my/tools/adt/sdk/
export ANDROID_NDK_ROOT=/home/user/my/tools/android-ndk-r8e/

I added following "
android_tools" folder
/home/user/my/android/webrtc/latest/trunk/third_party/android_tools

I added links

lrwxrwxrwx 1 user user 36 Mar 30 00:14 ndk -> /home/user/my/tools/android-ndk-r8e/
lrwxrwxrwx 1 user user 28 Mar 30 00:15 sdk -> /home/user/my/tools/adt/sdk/

Instead of python2.5-dev I installed python2.7-dev.


sudo ./build/install-build-deps-android.sh
0 upgraded, 0 newly installed, 0 to remove and 296 not upgraded.
install-build-deps-android.sh complete.


I proceeded with


gclient config https://webrtc.googlecode.com/svn/trunk
gclient sync


2. Generate makefiles:
source ./build/android/envsetup.sh


BUT It failed on


gclient runhooks


/bin/sh: 1: /home/user/my/android/webrtc/latest/trunk/third_party/android_tools/ndk//toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/*-gcc: not found
gyp: Call to '/home/user/my/android/webrtc/latest/trunk/third_party/android_tools/ndk//toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/*-gcc -print-libgcc-file-name' returned exit status 127. while trying to load trunk/webrtc.gyp
Error: Command /usr/bin/python trunk/build/gyp_chromium --depth=trunk trunk/webrtc.gyp -Dextra_gyp_flag=0 returned non-zero exit status 1 in /home/user/my/android/webrtc/latest



So I copied gcc

cp arm-linux-androideabi-gcc-4.6 arm-linux-androideabi-gcc

It helped to pass that step but failed on next step

make
CC(target) out/Debug/obj.target/signal_processing/webrtc/common_audio/signal_processing/auto_corr_to_refl_coef.o
Assembler messages:
Fatal error: invalid -march= option: `armv7-a'
make: *** [out/Debug/obj.target/signal_processing/webrtc/common_audio/signal_processing/auto_corr_to_refl_coef.o] Error 2


I afraid I am using wrong: NDK or OS

Please help or
share your working configuration: OS version, NDK version, revision of code etc

Thank You



Ken Ko

unread,
Apr 9, 2013, 1:09:53 PM4/9/13
to discuss...@googlegroups.com
Note that this is all with a 64bit build using ndk-r8e 64bit toolchain.

In my .bashrc, I have the environment variables ANDROID_SDK_ROOT and ANDROID_NDK_ROOT pointing to where my SDK and NDK are, respectively. This may help your other issue about *-gcc not found.

After you envsetup.sh, modify your GYP_DEFINES to be:

GYP_DEFINES="build_with_libjingle=1 build_with_chromium=0 libjingle_java=1 $GYP_DEFINES"

Consider also adding tracing functionality to help in debugging future issues:

export GYP_DEFINES="enable_tracing=1 $GYP_DEFINES"

I'm not sure if the this part is _necessary_, but I recall tracing through an ant build file or gyp file and needing to export my JAVA_HOME path:

export JAVA_HOME="/usr/lib/jvm/java-7-oracle/"
export PATH=$JAVA_HOME/bin:$PATH

Obviously you'll want to change that to wherever your java libs are located. 

You should now be able to run gclient runhooks successfully.

Some of this is documented in the README found in the demo android application directory. 

Max

unread,
Apr 9, 2013, 1:14:32 PM4/9/13
to discuss...@googlegroups.com
You definitely need 64 bit linux.

But my bug was that I was using Nautilus to unzip NDK.
You should use command line.

Maulik Prabhudesai

unread,
Apr 10, 2013, 8:58:55 AM4/10/13
to discuss...@googlegroups.com
Thank You Ken and Max. gclient runhooks does not throw errors anymore.

However after make
CXX(target) out/Debug/obj.target/libjingle_peerconnection_so/talk/app/webrtc/java/jni/peerconnection_jni.o
talk/app/webrtc/java/jni/peerconnection_jni.cc:55:17: fatal error: jni.h: No such file or directory
compilation terminated.

I checked that the jni.h file was present in the android_tools/ directory and in the directory where I have installed my NDK. 
In my bashrc, I have the environment variables ANDROID_SDK_ROOT and ANDROID_NDK_ROOT set as ANDROID_NDK_ROOT=/home/mprabhudesai/android/android-ndk-r8e/

However I do not see any jni.h in my Java_Home which is /usr/lib/jvm/java-6-openjdk

Do I need a newer version of Java ? do you think the problem lies with the android ndk or the java tool chain ? 



Hartelijke groeten /Warm regards /शुभेच्छा 

Maulik Prabhudesai 
m.prab...@student.tudelft.nl
MSc student, EWI, TU-Delft




--

--- 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/groups/opt_out.



Maulik Prabhudesai

unread,
Apr 10, 2013, 11:14:51 AM4/10/13
to discuss...@googlegroups.com
The compilation worked. I did gclient sync again. make works without errors now.

thanks


Hartelijke groeten /Warm regards /शुभेच्छा 

Maulik Prabhudesai 
m.prab...@student.tudelft.nl
MSc student, EWI, TU-Delft


Kam Kam

unread,
Nov 21, 2013, 2:01:42 PM11/21/13
to discuss...@googlegroups.com
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.

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




Hi, how did You manage to finally run gclient runhooks? I'm using 32bit architecture and nothing works for me...still got the error about the wrong directory.I tried everything and I still got that error. Appreciate any help from anybody, cause it's an emergancy. Thanks! 

Max

unread,
Nov 22, 2013, 3:02:02 AM11/22/13
to discuss...@googlegroups.com
32bit would not work

Cheers
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/sly5YK7AVuA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to discuss-webrt...@googlegroups.com.

Kam Kam

unread,
Nov 22, 2013, 5:11:11 AM11/22/13
to discuss...@googlegroups.com
Well, I need to get 64 bit system then :)

Thank You!

balaji sunku

unread,
Feb 6, 2014, 7:44:43 AM2/6/14
to discuss...@googlegroups.com
I also have the same problem. when i run the "gclient runhooks" command it is unable to find the src/third_party/android_tools. How you have created it manually. Please tell me. i have to get rid of this error. Urgent :(


On Wednesday, April 3, 2013 5:04:08 PM UTC+5:30, Max Koshevoy wrote:
Thank You!

I have not noticed when my post passed moderation.

I have made following modification to .gclient

solutions = [
  { "name"        : "trunk",
    "url"         : "https://webrtc.googlecode.com/svn/trunk",
    "deps_file"   : "DEPS",
    "managed"     : True,
    "custom_deps" : {
    },
    "safesync_url": ""
  },
]
target_os = ["android"]


It still does not create android_tools automatically. But when I create them manually I am able to compile code.

Maulik Prabhudesai

unread,
Feb 6, 2014, 2:50:32 PM2/6/14
to discuss...@googlegroups.com
try doing target_os = ["unix", "android"]

it worked for me


Hartelijke groeten /Warm regards /शुभेच्छा 

Maulik Prabhudesai


--
Reply all
Reply to author
Forward
0 new messages