Discussion:
A problem of making the "HelloJni" app be a system application...
(too old to reply)
tgh
2009-09-04 12:26:43 UTC
Permalink
I have tried to make the NDK-example application "HelloJni" be a
system application by the following steps:

1. generate the HelloJni.apk by Eclipse.
2. put HelloJni.apk into the directory /mydroid/out/target/product/
generic/system/app
3. cd /mydroid/; make snod
4. I get the "system.img" from /mydroid/out/target/product/generic/
5. Run the android emulator with the "system.img"
From File Explorer in DDMS, I can see the file/directories
/system/app/HelloJni.apk,
/data/data/com.example.hellojni,
and its sub-directory:
/data/data/com.example.hellojni/lib

However, the .so file "libhello-jni.so" didn't exist in "/data/data/
com.example.hellojni/lib/" or "/system/lib/"!!
And then, I get the "java.lang.UnsatisfiedLinkError" exception...

"libhello-jni.so" should be automatically copied to "/data/data/
com.example.hellojni/lib/" by android OS, isn't it?

(If I use "adb install HelloJni.apk" or put "libhello-jni.so" into "/
data/data/com.example.hellojni/lib/" mamually, the application runs
smoothly! )

My problem is that why the .so file "libhello-jni.so" didn't be copied
into "/data/data/com.example.hellojni/lib" automatically while
HelloJni.apk as a system application??

Does anyone know why?

Thanks!!


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to android-***@googlegroups.com
To unsubscribe from this group, send email to android-ndk+***@googlegroups.com
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en
-~----------~----~----~----~------~----~------~--~---
fadden
2009-09-04 17:15:08 UTC
Permalink
Post by tgh
My problem is that why the .so file "libhello-jni.so" didn't be copied
into "/data/data/com.example.hellojni/lib" automatically while
HelloJni.apk as a system application??
My understanding is that, for a system APK, the shared library is also
expected to live in /system. Since /system is mounted read-only, this
has to be done as part of creating the system image.

When you use "adb install", the app lives in /data, so the shared
library lives there as well and is unpacked by the installer.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to android-***@googlegroups.com
To unsubscribe from this group, send email to android-ndk+***@googlegroups.com
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en
-~----------~----~----~----~------~----~------~--~---
Mohammad Saleh Dehghanpour
2018-10-02 12:50:23 UTC
Permalink
Hello
I put lib folder along my 3rd party apks in correct path but ther were not
copied when building SDK to /system/lib or /system/lib64
Although for other apps the libraries i.e. .so files are copied
automatically

So I should manually copy them to have working apps after burning image!

Do you know the problem?

Thanks a lot
Post by fadden
Post by tgh
My problem is that why the .so file "libhello-jni.so" didn't be copied
into "/data/data/com.example.hellojni/lib" automatically while
HelloJni.apk as a system application??
My understanding is that, for a system APK, the shared library is also
expected to live in /system. Since /system is mounted read-only, this
has to be done as part of creating the system image.
When you use "adb install", the app lives in /data, so the shared
library lives there as well and is unpacked by the installer.
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk+***@googlegroups.com.
To post to this group, send email to android-***@googlegroups.com.
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/0c8cb6d1-56e1-4133-a88a-0a5ed02ee211%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...