Has the library location moved to Android 4.2.1?

I got a suspicious issue when I tried to update my android app to work with 4.2.1, Nexus 7. I am using my own .so library, which worked fine on Android 4.1 before I upgraded. Now I am getting all kinds of problems.

I have been comparing the logs when deploying to an Android device running 3.2.1 and my Nexus 7 running 4.2.1. The library is placed in two different locations, which can cause problems.

ANDROID 3.2.1:

Trying to load lib /data/data/com.my.app/lib/lib_my_app_jni.so 0x407e8218
Added shared lib /data/data/com.my.app/lib/lib_my_app_jni.so 0x407e8218

      

ANDROID 4.2.1 (Nexus 7):

Trying to load lib /data/app-lib/com.my.app-1/lib_my_app_api_jni.so 0x4257b6c8
Added shared lib /data/app-lib/com.my.app-1/lib_my_app_api_jni.so 0x4257b6c8

      

Why is all of this suddenly put into the secret app-lib dir? How can I get it back? And where is this documented?

Thank...

+3


source to share


2 answers


I'm going to answer my own question because we ended up implementing our library in a different way than originally intended.

The problem was that we were copying the access certificates and more to the directory where the library was located. This approach worked fine on older versions of Android where it was located in data / data / package /. But on newer Android versions (data / app-lib / package /) this location is read-only.



What we did was just move the location. Thanks for the input.

0


source


From Android 4.2, multiplayer function is added to Android framework.

And a few directory locations have changed, but the API doesn't change, like Context.get ??? Dir () or Context.get ??? Path (). (only the return value changes)



Also the Android platform creates a symbolic link for the legacy.

These changes are not documented.

+6


source







All Articles