5

I have created an application which will be a System Application. When I install the application normally(not as system application) ".so" files are getting loaded. But when I'm making it a system application by putting the apk into /system/app/ , I'm getting the following error

01-09 00:20:26.889: E/AndroidRuntime(2101): java.lang.UnsatisfiedLinkError: Couldn't load iconv from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/system/framework/com.google.android.maps.jar", zip file "/system/app/My.apk"],nativeLibraryDirectories= [/vendor/lib, /system/lib]]]: findLibrary returned null

Research that I have done on this -

It seems that ".o" and ".so" files are located in /system/lib/ and /vendor/lib/ .

Even after adding the files to the respective directories, still failing to load the libraries.

Any Help would be appreciated.

mn0102
  • 839
  • 1
  • 12
  • 25
  • Did you try to reboot the target after pushing the .so file to `/system/lib/`? – ozbek Jan 03 '14 at 16:46
  • yes I did. But getting the same error. This path is returning null. Is there a way that I can set the path as Environment Variables, so that I can get this thing done? I also have .so files in the application's "libs/armeabi", "libs/armeabi-v71" and "x86" directories. – mn0102 Jan 04 '14 at 07:42

1 Answers1

8

In my case the issue was related to permissions. After putting the ".SO" files into respective directories, I modified the default allocated permissions 600 to 755. It worked well.

mn0102
  • 839
  • 1
  • 12
  • 25
  • Be so kind to add this case to the long list of similar mistakes at http://stackoverflow.com/questions/9037966/android-ndk-java-lang-unsatisfiedlinkerror-findlibrary-returned-null – Alex Cohn Jan 08 '14 at 10:41
  • 3
    While the issue is real, your settings are incorrect. You are missing the execute bit, so this won't work on ARM systems which enforce that. Normal .so file permissions on Android are 755. – Chris Stratton Aug 07 '14 at 14:42
  • @ChrisStratton thanks for correcting. I dint mention it but I used 755, default were 600 on one of my lab's android devices. – mn0102 Aug 08 '14 at 11:38
  • where to change these permissions? – TaRan LaYal Mar 16 '16 at 09:46
  • @TaRanLaYal $ su # cp /some/path/on/your/device/your.so /system/lib/ # chmod 755 /system/lib/your.so # reboot – mn0102 Mar 17 '16 at 09:20
  • after hitting this line on terminal--- su # cp /home/taran/TaRanSinGH/MyApplication/libs/armeabi libcws_ps_4_0_3.so//system/lib/ # chmod 755 /system/lib/LIBCWS_PS_4_0_3.SO.so I am getting su: Authentication failure – TaRan LaYal Mar 17 '16 at 12:05
  • You need root access for this. – mn0102 Jul 01 '16 at 16:15