3

I developed application with native libraries. In regular case it working correctly, but when I move it in /system/app after reloading I seen what missed /data/app-lib/com.my.app folder with *.so files. However, symlink lib in /data/data/com.my.app exist.

Device Nexus 4

Please help me to resolve this situation. Any help will be appreciated

NikedLab
  • 883
  • 4
  • 11
  • 31
  • Why do you move in the first place ? Libraries shall be placed in /Project/libs in your Android project before exporting the .apk in which case the libraries are automatically copied where appropriated. – Antoine Marques Aug 07 '14 at 14:03
  • 2
    Please read my question again. Application working correctly in common case. But not working as system application – NikedLab Aug 07 '14 at 14:09
  • Do you have write permission to the /system folder on the device? (this might be a stupid question). It works fine here on a rooted device with full permissions. – RossC Aug 07 '14 at 14:12
  • Not comprehensive enough to call a duplicate, but this might be interesting: http://stackoverflow.com/questions/20906445/unable-to-load-so-library-files-when-making-a-system-application – Chris Stratton Aug 07 '14 at 14:47

1 Answers1

1

I'd be surprised if the OP has been searching for the answer for half a decade, and I don't think this fix existed back then, but for other people searching their way here today:

For some reason, Android doesn't extract native libraries from apps in /system/priv-app. It just symlinks /data/data/app/lib -> /system/priv-app/app/lib. This means you need to also copy all libraries into /system/priv-app/app/lib. If you're building in Windows, make sure to also chmod the library to 0755 after copying it in.

Glenn Maynard
  • 55,829
  • 10
  • 121
  • 131
  • Would you know if `extractNativeLibs="false"` is supposed not to work on Oreo at least, with the app installed as system app (/system/priv-app)? I was thinking I wouldn't have the problem of this thread if I'd set it to false, but it seems I'm receiving UnsatisfiedLinkErrors anyway – Edw590 May 23 '22 at 16:52