Hi APT,

 

We should probably move this discussion to the NDK group, as Dianne suggested.

 

XYZ.so may have an unresolved symbol.  One trick we’ve found is using  
`arm-eabi-objdump xyz.so -t | grep UND` and see if anything you expect to be 
resolved is actually unresolved.  Do you see any output from the linker using 
strace or from the commandline?  That might tell you exactly what’s missing.

 

-Kevin

 

From: android-framework@googlegroups.com 
[mailto:android-framew...@googlegroups.com] On Behalf Of MMF
Sent: Thursday, April 23, 2009 12:31 AM
To: android-framework@googlegroups.com
Subject: Re: Issues while loading native .so files from JNI

 

Hi All,

I have nailed down the problem to xyz.so.
When I remove xyz.so from my dependency list I am able to load my jni.so from 
the App properly.
Not sure why this is happening, as I am able to test my jni.so from native test 
app which is dependent on both abc.so and xyz.so.
But when I do the same thing from App the jni.so is not getting loaded.
Looks like some problem with my xyz.so.

Another observation, if I replace my xyz.so with any other lib (copy some other 
.so and rename it to xyz.so) I am able to load my jni.so.
I will debug it further and let you all know the exact root cause of this 
issue. ( one wild guess is my xyz.so is having lot of assembly code and this 
could be one of problems).

Thanks a lot for your inputs.

Regards
APT

2009/4/23 Hsiung, Chuan-Da 熊全達 <cdhsi...@gmail.com>

APT, could you try to remove abc.so and xyz.so from the prelink map?

CD

 

On Wed, Apr 22, 2009 at 10:39 PM, MMF <android...@gmail.com> wrote:

Hi Naveen,

I have tried all the options.
It is not about the name which I mention. If I am loading a jni.so which is 
having dependencies on some other .so files then it is giving me an error else 
it works fine.

Thanks
APT

 

On Wed, Apr 22, 2009 at 7:01 PM, Naveen Krishna Ch <naveenkrishna...@gmail.com> 
wrote:

Now i figured out the actual prblem 

system.loadlibrary("jni.so");
change it to 
system.loadlibrary("jni");

This is what u gotto mention

2009/4/22 Naveen Krishna Ch <naveenkrishna...@gmail.com>

         

         

        2009/4/22 MMF <android...@gmail.com>

                Hi Naveen,

                
                
                Thanks for the reply.
                I have already mentioned both abc.so and xyz.so as dependencies 
libs for jni.so.
                I suppose without mentioning this my jni.so itself would not 
get generated.
                But still I get the mentioned error.
                I think there something more to it than just mentioning the 
dependencies.

        Then i guess that missing thing is pushing the jni.so lib to emulator 
with adb push .. 
        Are u using the Eclipse + Android SDk or u also have the Android Sources

                
                Thanks
                APT

                On Wed, Apr 22, 2009 at 5:45 PM, Naveen Krishna Ch 
<naveenkrishna...@gmail.com> wrote:

                        Hi APT/MMF,
                        
                        I have a similar need and i could make it work.
                        
                        abc.so and jni.so in my case. 
                        
                        during the android build of jni.so i gave the abc.so as 
depended
                        shared libray in the Android.mk of jni. 
                        
                        And in Java application i loaded the jni.so and it is 
working. 
                        
                        I wish this would help u too 

                        2009/4/22 MMF <android...@gmail.com>

                                 

                                Hi All,
                                
                                I am facing a problem while loading .so libs 
from my App.
                                
                                Here is the story:
                                
                                I have two native libs say abc.so and xyz.so.
                                I have written a JNI component (say jni.so) 
which is calling APIs from abc.so and xyz.so.
                                
                                Now from the application (Java) when I do 
system.loadlibrary("jni.so") I get an error as "cannot find library".
                                
                                But when I remove the dependencies of abc.so 
and xyz.so from jni.so (say I just have some dummy functions in my jni.so) and 
try to load jni.so from App, it works fine.
                                
                                Can someone please let me know what could be 
problem?
                                
                                Thanks
                                APT
                                
                                

                        
                        
                        
                        -- 

                        Cheers
                        (: Naveen Krishna Ch :)

                 

        
        
        
        -- 
        Cheers
        (: Naveen Krishna Ch :)




-- 
Cheers
(: Naveen Krishna Ch :)

 

 



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


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

Reply via email to