-
Notifications
You must be signed in to change notification settings - Fork 173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SoLoader can't find .so deps when app is packaged as Prebuilt APK with Android AOSP Source #28
Comments
Oh - and some extra context: I've tried unpacking all of the .so files from the APK, and adding them as prebuilts to the AOSP build process, like so (via the
and adding
to the prebuilt block itself but to no avail. |
Sadly, this is way out of my comfort zone, so I can't give you any good advice here but the main issue appears to be
I'm not sure if there are certain filesystem/mount flags that would prevent mapping the file from that location or if it's a security restriction in the Android runtime only allowing Googling for "dlopen failed: couldn't map" brings up a lot of Android-related issues, but nothing particularly actionable. Others have suggested copying the files to an application-private location. Perhaps you could do that as a workaround on startup. |
Cool yeah. I have a feeling that "permission denied" is actually because the file doesn't exist. I'm still working on this, but when I solve it I'll come back and update this issue to help anyone else who comes this way. |
Hi. Did you fix it? |
hi @SergiiGudym - yup I did. So - for anyone else: If you're embedding your APK into a AOSP build that will packaged with the ROM, it's important to note a few things:
So - when you're packaging your React Native app with an AOSP ROM, you'll need to do the following:
Some gotchas:
|
@passy this can be closed, fwiw. Thought i'd leave it open in case anyone has more questions! |
@hhff Is there anything else that has to be done? I've added everything to Android.mk, but my app still doesn't run and the libraries don't even appear in the target folder. |
It seems that it's also necessary to add all the libraries to your app's module in Android.mk with LOCAL_SHARED_LIBRARIES.
|
Cool thanks @ozymand1as ! FWIW - I didn't have to do that, but it's likely we're running different versions of AOSP so perhaps thats the reason |
Summary: Fix to allow SoLoader to find .so deps when app is packaged as Prebuilt APK with Android AOSP Source When an apk has .so files as part of the APK, the Android make system will generate the APK so as to allow .so files to be loaded directly. Another option is to include the .so in system libs by updating the Android make file but that means that the files are shared across the OS and can cause conflicts with applications that may want their own version of the .so Possible fix for issue #28 How to use: SoLoader.init(mContext, SOLOADER_DISABLE_BACKUP_SOSOURCE); SoLoader.setSystemLoadLibraryWrapper( new SystemLoadLibraryWrapper() { Override public void loadLibrary(String libName) { System.loadLibrary(libName); } }); Reviewed By: joelmccall Differential Revision: D15082630 fbshipit-source-id: 68db389bc105929c6cba7a92285c5a3df947f51c
Version 0.10.3 has been released which includes this fix. |
Thanks so much for the hard work here!
I have a unique situation that perhaps you can shed some light on!
I am building a React Native Android application that will ship with an Android Device, and therefore it's being included in the AOSP build process as a prebuilt APK.
When I install the APK via ADB, it runs great! However, when I build the Android source including the App, I flash the device, and see the App on the homescreen. However, when it boots, I see the following logs from SoLoader:
It appears to me that the install process that moves the .so files to the appropriate place on the Android filesystem isn't being run for the packaged app in the AOSP build step (but I have confirmed they are in the APK itself by unzipping and checking).
What should I do to get this working as an Android prebuilt?
Thank you!
The text was updated successfully, but these errors were encountered: