Hi David,

Thanks so much for your post...very helpful :) I'll definitely try the
'user' build and check the issue.
I'm not exactly sure which tool to use for getting a dump of the
dynamic section and dynamic symbol table...is it 'nm'?

Thanks,
Piyush


On Nov 18, 8:26 pm, David Turner <di...@android.com> wrote:
> On Wed, Nov 17, 2010 at 7:24 AM, Piyush Khanna 
> <piyushkhann...@gmail.com>wrote:
>
>
>
> > Hi,
>
> > I am an Android app developer, and I have purchased a Nexus One device
> > which I use to continuously test my developed Android applications.
>
> > Background:
> > -----------------
> > One of the applications I developed uses a native shared library (e.g.
> > myNativeLib.so). Only my application loads & uses this native library.
> > I had developed this app before Android NDK came out. I pack my native
> > library into my apk's 'assets' folder, and during my application start-
> > up, I extract this native library from my package's assets folder to
> > my app private directory (i.e. <assets> -> /data/data/<myappprocess>/
> > myNativeLib.so). Then I use System.load() API in my application to
> > dynamically load this native library.
>
> > Does your library depends on a system library that was not exposed through
>
> the NDK?
> If so, this behaviour is to be expected. Otherwise, this is strange.
>
>
>
> > Problem:
> > ------------
> > This application was developed during Android 1.5 (i.e. cupcake) days
> > {I didn't have the Nexus One then}. The above procedure has been
> > working without any problems right from Android 1.5 to Android 2.2
> > (i.e. Froyo). I have also tested the same on my Nexus One for Android
> > 2.1 (i.e. Eclair) and Android 2.2.
>
> > The problem began the moment I recently upgraded my Nexus One to
> > Android 2.2.1 via the FRG83 system update. Now, whenever I try to load
> > my native library, I get the following error:
>
> > D/dalvikvm( 3653): Trying to load lib /data/data/<myappprocess>/
> > <mynativelib>.so <some address>
> > I/dalvikvm( 3653): Unable to dlopen(/data/data/<myappprocess>/
> > <mynativelib>.so): Cannot load library: link_image[1995]: failed to
> > link <mynativelib>.so
>
> > I believe there should be an error message from the linker just before that
>
> which indicates what the problem with your library is
> (e.g. missing symbol or library dependency). Can you look at it?
>
>
>
> > What I have Tried:
> > --------------------------
> > 1. I tried my application using Android 2.2 SDK (emulator)...it works,
> > no issues.
> > 2. I checked out the latest froyo & android2.2.1 source code from
> > Android open-source, built & tested my application
> >   + native lib using the latest froyo source...it built & ran, no
> > issues. This should've taken care of any changes in the
> >   native code dependencies between Android 2.2 & Android 2.2.1
> > 3. I even checked Android 2.2.1 source code for dalvik (java System &
> > Runtime classes)  + bionic (linker & dlopen
> >    sources) between Android 2.2 & Android 2.2.1 (using source checked
> > out from Android open-source), but couldn't
> >    find anything consequential
> > 4. I am unable to return my Nexus One to Android 2.2 :(
>
> > I'm now confused...is the open-sourced-code for Android 2.2.1
> > different from what's available on Nexus One? What can I do to make my
> > application work on Nexus One?
>
> The FRG83 image does not correspond 100% to the content of the Android
> open-source tree,
> but the most likely reason for the difference might be that you are running
> a "user" build on the
> Nexus, while you built a "user-debug" or "eng" build from the source tree.
> They have a few
> differences related to security which might explain the issue.
>
> It's hard to tell without more information. For the record, can you dump the
> dynamic section and dynamic symbol table from your shared library?
>
>
>
> > ---------------------------------------
> > ---------------------------------------
> > Device: Nexus One
> > Carrier: Airtel
> > Country / Language: India/en
> > OS / build number (if applicable): Android 2.2.1 / FRG83
> > ---------------------------------------
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to android-developers@googlegroups.com
> > To unsubscribe from this group, send email to
> > android-developers+unsubscr...@googlegroups.com<android-developers%2bunsubscr...@googlegroups.com>
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en

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

Reply via email to