JNI application using ndk

211 views
Skip to first unread message

Geetha Arumugam

unread,
Jan 12, 2010, 5:28:28 AM1/12/10
to Android-x86
Hi Folks,

I compiled jni application using ndk and installed the .apk on
emulator, which works fine. But when try to install it on x86 platform
it show installation failure as INSTALL_FAILED_CPU_ABI_INCOMPATIBLE .
Please reply me.

Thanks,
Geetha A

Yi Sun

unread,
Jan 12, 2010, 12:32:16 PM1/12/10
to andro...@googlegroups.com
you compiled a arm binary, you need to build x86 binary by put target
product to eeepc

> --
> You received this message because you are subscribed to the Google Groups "Android-x86" group.
> To post to this group, send email to andro...@googlegroups.com.
> To unsubscribe from this group, send email to android-x86...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/android-x86?hl=en.
>
>
>
>

--
Android-x86
http://www.android-x86.org

Geetha Arumugam

unread,
Jan 18, 2010, 12:29:40 AM1/18/10
to Android-x86
Hi Yi,
Thanks for your reply. I build x86 binary only for target product
to eeepc. I need help in JNI application for x86

Thanks,
Geetha

Yi Sun

unread,
Jan 18, 2010, 12:49:19 AM1/18/10
to andro...@googlegroups.com
if your native code can run on Android emulator (the one comes with
SDK), it means that it has an ARM binary (Or you have recompiled it to
use ARM SDK, please let me know which that case is).
Another thing could cause issue is that your base system (the
android-x86) has a wrong abi configuration. Since you did not tell me
which release of android-x86 you are using (btw-- which ndk are you
using?), check your TARGET_CPU_ABI and make sure that it is x86. In
the worse case, debug the package manager to find out what the issue
is.

Geetha Arumugam

unread,
Jan 18, 2010, 1:44:39 AM1/18/10
to Android-x86
Hi Yi,
Thanks for your reply. I tried the JNI application in the
following way
1. I am using android-x86 ndk(downloaded from http://www.android-x86.org/download).
I compiled JNI application using this ndk and it compile the .so for
x86 platform. I install this apk on emulator but its shows some
exception.
2. I build the android-x86/development/sample/SimpleJNI example, then
tried to install in x86 platform but it displayed
INSTALL_FAILED_CPU_ABI_INCOMPATIBLE.

How can I check my TARGET_CPU_ABI?
I need the help how to compile sample given under ndk on android-x86
source code.

Thanks,
Geetha

Yi Sun

unread,
Jan 18, 2010, 2:00:25 AM1/18/10
to andro...@googlegroups.com
On Sun, Jan 17, 2010 at 10:44 PM, Geetha Arumugam
<geetha.a...@gmail.com> wrote:
> Hi Yi,
>    Thanks for your reply. I tried the JNI application in the
> following way
>  1. I am using android-x86 ndk(downloaded from http://www.android-x86.org/download).
> I compiled JNI application using this ndk and it compile the .so for
> x86 platform. I install this apk on emulator but its shows some
> exception.
This is expected since you are trying to run an x86 binary on ARM platform

>  2. I build the android-x86/development/sample/SimpleJNI example, then
> tried to install in x86 platform but it displayed
> INSTALL_FAILED_CPU_ABI_INCOMPATIBLE.
>
> How can I check my TARGET_CPU_ABI?
It depends on the android-x86 release you are using. The simplest way
is to boot up your device and in the terminal emulator, try getprop
ro.product.cpu.abi. It should show something like x86.

> I need the help how to compile sample given under ndk on android-x86
> source code.
There is a wiki page for this in www.android-x86.org

Geetha Arumugam

unread,
Jan 18, 2010, 2:32:13 AM1/18/10
to Android-x86
Hi Yi,
I tried getpropro.product.cpu.abi from the terminal emulator but it
displayed permission denied.
> ro.product.cpu.abi
On Jan 18, 12:00 pm, Yi Sun <beyo...@gmail.com> wrote:

> On Sun, Jan 17, 2010 at 10:44 PM, Geetha Arumugam<geetha.arumug...@gmail.com> wrote:
> > Hi Yi,
> >    Thanks for your reply. I tried the JNI application in the
> > following way
> >  1. I am using android-x86 ndk(downloaded fromhttp://www.android-x86.org/download).

Yi Sun

unread,
Jan 18, 2010, 2:36:12 AM1/18/10
to andro...@googlegroups.com
getprop ro.product.cpu.abi, you need to put space after getprop.
You have to tell me which release of android-x86 you are using.
Otheriwse, I will not be able to help you more.

Geetha Arumugam

unread,
Jan 18, 2010, 2:44:52 AM1/18/10
to Android-x86
Hi Yi,
I tried getprop ro.product.cpu.abi and it displayed none. I am using
2.6.29 version of android-x86

Yi Sun

unread,
Jan 18, 2010, 2:54:12 AM1/18/10
to andro...@googlegroups.com
On Sun, Jan 17, 2010 at 11:44 PM, Geetha Arumugam
<geetha.a...@gmail.com> wrote:
> Hi Yi,
> I tried getprop ro.product.cpu.abi and it displayed none. I am using
> 2.6.29 version of android-x86
>
2.6.29 is a kernel version and the problem you having has nothing to
do with the kernel version. Anyway, download the android-x86 1.6 from
http://www.android-x86.org/download and try again. You should be fine.

Geetha Arumugam

unread,
Jan 18, 2010, 3:07:00 AM1/18/10
to Android-x86
Hi Yi
I am using Android 1.5


On Jan 18, 12:54 pm, Yi Sun <beyo...@gmail.com> wrote:


> On Sun, Jan 17, 2010 at 11:44 PM, Geetha Arumugam<geetha.arumug...@gmail.com> wrote:
> > Hi Yi,

> > I tried getprop ro.product.cpu.abi and it displayed none. I am using
> > 2.6.29 version of android-x86
>
> 2.6.29 is a kernel version and the problem you having has nothing to

> do with the kernel version. Anyway, download the android-x86 1.6 fromhttp://www.android-x86.org/downloadand try again. You should be fine.

Yi Sun

unread,
Jan 18, 2010, 3:11:48 AM1/18/10
to andro...@googlegroups.com
sigh........
before 1.6 there are 5 releases, anyway, it is not important anymore
since your build is too old.

Geetha Arumugam

unread,
Jan 18, 2010, 3:14:56 AM1/18/10
to Android-x86
Hi Yi,
Why I need android-x86 1.6? Can't I try JNI application by using
android 1.5?

On Jan 18, 1:11 pm, Yi Sun <beyo...@gmail.com> wrote:
> sigh........
> before 1.6 there are 5 releases, anyway, it is not important anymore
> since your build is too old.
>
> On Mon, Jan 18, 2010 at 12:07 AM, Geetha Arumugam
>
>
>
> <geetha.arumug...@gmail.com> wrote:
> > Hi Yi
> > I am using Android 1.5
>
> > On Jan 18, 12:54 pm, Yi Sun <beyo...@gmail.com> wrote:
> >> On Sun, Jan 17, 2010 at 11:44 PM, Geetha Arumugam<geetha.arumug...@gmail.com> wrote:
> >> > Hi Yi,
> >> > I tried getprop ro.product.cpu.abi and it displayed none. I am using
> >> > 2.6.29 version of android-x86
>
> >> 2.6.29 is a kernel version and the problem you having has nothing to

> >> do with the kernel version. Anyway, download the android-x86 1.6 fromhttp://www.android-x86.org/downloadandtry again. You should be fine.

Yi Sun

unread,
Jan 18, 2010, 3:33:08 AM1/18/10
to andro...@googlegroups.com
I don't know if you have a source tree for your build or not. To fix
your problem you need to rebuild android-x86 and set TARGET_CPU_ABI to
x86. You can find TARGET_CPU_ABI in vendor directory.

BTW--your problem has nothing to do with JNI. It is a NDK issue. You
can use JNI without NDK.

Geetha Arumugam

unread,
Jan 18, 2010, 3:38:47 AM1/18/10
to Android-x86
Hi Yi,
I tried JNI without using NDK (example given under /developement/
samples/SimpleJNI). But .so is created for arm platform not for x86.
How can I compile and test JNI for my x86 platform.

> >> >> do with the kernel version. Anyway, download the android-x86 1.6 fromhttp://www.android-x86.org/downloadandtryagain. You should be fine.


>
> >> >> > On Jan 18, 12:36 pm, Yi Sun <beyo...@gmail.com> wrote:
> >> >> >> getprop ro.product.cpu.abi, you need to put space after getprop.
> >> >> >> You have to tell me which release of android-x86 you are using.
> >> >> >> Otheriwse, I will not be able to help you more.
>
> >> >> >> On Sun, Jan 17, 2010 at 11:32 PM, Geetha Arumugam
>
> >> >> >> <geetha.arumug...@gmail.com> wrote:
> >> >> >> > Hi Yi,
> >> >> >> >   I tried getpropro.product.cpu.abi from the terminal emulator but it
> >> >> >> > displayed permission denied.
> >> >> >> >> ro.product.cpu.abi
> >> >> >> > On Jan 18, 12:00 pm, Yi Sun <beyo...@gmail.com> wrote:
> >> >> >> >> On Sun, Jan 17, 2010 at 10:44 PM, Geetha Arumugam<geetha.arumug...@gmail.com> wrote:
> >> >> >> >> > Hi Yi,
> >> >> >> >> >    Thanks for your reply. I tried the JNI application in the
> >> >> >> >> > following way

> >> >> >> >> >  1. I am using android-x86ndk(downloaded fromhttp://www.android-x86.org/download).
> >> >> >> >> > I compiled JNI application using thisndkand it compile the .so for


> >> >> >> >> > x86 platform. I install this apk on emulator but its shows some
> >> >> >> >> > exception.
>
> >> >> >> >> This is expected since you are trying to run an x86 binary on ARM platform>  2. I build the android-x86/development/sample/SimpleJNI example, then
> >> >> >> >> > tried to install in x86 platform but it displayed
> >> >> >> >> > INSTALL_FAILED_CPU_ABI_INCOMPATIBLE.
>
> >> >> >> >> > How can I check my TARGET_CPU_ABI?
>
> >> >> >> >> It depends on the android-x86 release you are using. The simplest way
> >> >> >> >> is to boot up your device and in the terminal emulator, try getprop

> >> >> >> >> ro.product.cpu.abi. It should show something like x86.> I need the help how to compile sample given underndkon android-x86


> >> >> >> >> > source code.
>
> >> >> >> >> There is a wiki page for this inwww.android-x86.org
>
> >> >> >> >> > Thanks,
> >> >> >> >> > Geetha
>
> >> >> >> >> > On Jan 18, 10:49 am, Yi Sun <beyo...@gmail.com> wrote:
> >> >> >> >> >> if your native code can run on Android emulator (the one comes with
> >> >> >> >> >> SDK), it means that it has an ARM binary (Or you have recompiled it to
> >> >> >> >> >> use ARM SDK, please let me know which that case is).
> >> >> >> >> >> Another thing could cause issue is that your base system (the
> >> >> >> >> >> android-x86) has a wrong abi configuration. Since you did not tell me

> >> >> >> >> >> which release of android-x86 you are using (btw-- whichndkare you


> >> >> >> >> >> using?), check your TARGET_CPU_ABI and make sure that it is x86. In
> >> >> >> >> >> the worse case, debug the package manager to find out what the issue
> >> >> >> >> >> is.
>
> >> >> >> >> >> On Sun, Jan 17, 2010 at 9:29 PM, Geetha Arumugam
>
> >> >> >> >> >> <geetha.arumug...@gmail.com> wrote:
> >> >> >> >> >> > Hi Yi,
> >> >> >> >> >> >   Thanks for your reply. I build x86 binary only for target product
> >> >> >> >> >> > to eeepc. I need help in JNI application for x86
>
> >> >> >> >> >> > Thanks,
> >> >> >> >> >> > Geetha
>
> >> >> >> >> >> > On Jan 12, 10:32 pm, Yi Sun <beyo...@gmail.com> wrote:
> >> >> >> >> >> >> you compiled a arm binary, you need to build x86 binary by put target
> >> >> >> >> >> >> product to eeepc
>
> >> >> >> >> >> >> On Tue, Jan 12, 2010 at 2:28 AM, Geetha Arumugam
>
> >> >> >> >> >> >> <geetha.arumug...@gmail.com> wrote:
> >> >> >> >> >> >> > Hi Folks,
>

> >> >> >> >> >> >> >    I compiled jni application usingndkand installed the .apk on

Yi Sun

unread,
Jan 18, 2010, 3:48:29 AM1/18/10
to andro...@googlegroups.com
1. get android-x86 source tree
2. make -j4 TARGET_PRODUCT=eeepc SimpleJNI

Geetha Arumugam

unread,
Jan 18, 2010, 3:55:09 AM1/18/10
to Android-x86
Hi Yi,
I set TARGET_CPU_ABI=x86 and compiled as you said. My doubt
whether .so created for x86 or arm platform

On Jan 18, 1:48 pm, Yi Sun <beyo...@gmail.com> wrote:
> 1. get android-x86 source tree
> 2. make -j4 TARGET_PRODUCT=eeepc SimpleJNI
>
> On Mon, Jan 18, 2010 at 12:38 AM, Geetha Arumugam
>
>
>

Yi Sun

unread,
Jan 18, 2010, 12:22:20 PM1/18/10
to andro...@googlegroups.com
run readelf or file on your object

Reply all
Reply to author
Forward
0 new messages