2

Steps to reproduce the problem: Install a (paid) app from the Play Store on a XPeria Z (model C6602 or C6603) that is using native (C++) libraries. The app will not find/load the native library on start-up. When sending the customer the exact same apk that was uploaded to the Play Store, there is no issue and everything works.

This bug appears on two of my apps (Audio Evolution Mobile and USB Audio Recorder PRO), and the bug reports only seem to come from XPeria Z users, running Android 4.2.2.

I have sent apk's of both apps to customers that purchased the apps and after installing they ran fine. This issue does not happen for other people with other devices.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
extreamsd
  • 23
  • 2
  • 1
    Does the problem occur with your free demo editions? What CPU architectures does your app support (based upon `Application.mk`)? – CommonsWare Jul 15 '13 at 18:41
  • Maybe related to http://code.google.com/p/android/issues/detail?id=34880 – j.holetzeck Jul 15 '13 at 19:42
  • I don't think I have reports on the demo versions, although one demo version is a direct apk download. I compile for armeabi and armeabi-v7. Note that this issue is not appearing on other devices so far and since directly emailing the apk makes it work, it's an interaction with the Play Store app, possibly 'optimizing out' the native shared objects. – extreamsd Jul 16 '13 at 15:14

1 Answers1

0

I am not sure if this is the exact same problem as yours but we had similar problem with native libraries not loading on xperia z. The problem was due to forward locking of paid apps, which was causing .so files to be located in different folder:

/mnt/asec/package_name-1/lib/libmy.so

instead of:

/data/data/package_name/lib/libmy.so

so if you load native lib like :

dlopen(lib_path, RTLD_LAZY);

using second path, then on XPeria Z it fails. You must try also this first path.

To reproduce this problem locally use:

adb install -l my.apk

Actually loading native library from java code worked correctly, the only problem was with libs being loaded in native code. I also wonder if this path can be hardcoded in code: package_name-1, looks like it might be package_name-2 one day:)

marcinj
  • 48,511
  • 9
  • 79
  • 100
  • I meanwhile came to the same conclusion, thanks. The libraries were actually loading after all, but I had a check in my code to find a library to see if the app was correctly installed. Apparently I was looking in the wrong directory: I now use ApplicationInfo's nativeLibraryDir to get the path if the user is running Android 2.3 or higher. This was part of the problem since I am building for 2.2, but I am using reflection now, so all solved. – extreamsd Aug 01 '13 at 10:42
  • Thanks for nativeLibraryDir hint, we have now faced this problem again with android 4.3 where libs folder changed to /data/app-lib/com.exampple.app/ – marcinj Aug 01 '13 at 13:40