-
Notifications
You must be signed in to change notification settings - Fork 358
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
Add support to 64 bit devices for Android #76
Comments
I can confirm the issue. As a temporary workaround you can place the |
Thanks, but where can I find the libj2v8_android_aarch64.so? in your jar in maven there are only the arm7i.so and x86.so.. |
Ups sorry... you can just rename the regular 32bit .so from project. |
Thanks again, I need to clarify:
What about x86_64? should I rename current libj2v8_android_x86.so to something else? and under which folder should I add the x86_64? Thanks :) |
I read your question wrong. My guess is that it works out of the box with x86 64bit since i do nothing special and can still deploy to an x86 64bit emulator. The subfolder workaround i mentioned above applies to 64bit arm support. |
We got exceptions on Android Asus devices running 64 bit, as you can see that the problem is "couldn't find j2v8_android_x86_64": Couldn't load j2v8_android_x86_64 from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.my-app.apk"],nativeLibraryDirectories=[/data/app-lib/com.my-app-2, /vendor/lib, /system/lib, /system/lib/arm]]]: findLibrary returned null Thanks again! |
I am pretty certain with the right combination of file name and folder structure it also works on on x86 64bit support. Maybe @irbull has got an idea. |
Hello gents, I'm having a similar issue on my 64 bit phone (Samsung s6 Egde). In my case libj2v8_android_armv7l.so is 32-bit instead of 64-bit seems to be the key. I'm using the latest jar (v3.0). Any guidance is much appreciated! Thanks in advance! Stack Trace Edited: @irbull, I wasn't sure if you were getting notifications of this thread so I thought I should give you a nudge to see if this rings a bell? Thanks again! |
I don't have an x86_64 based phone to test this on. There are two questions here:
Has anybody managed to extra the .so file, place it in a jniLibs directory and get it to load? If so, can you update us with the .so file you used and the naming scheme that worked? |
This is what is working for us so far. We were getting the same x86_64 load errors when using the Android emulator. When we added the 32bit version named as the 64bit binary, it works. I think the issue is a combination of Android's
Here it's hardcoded to look for the lib name with |
The problem is that It's good to know that the existing native bits work, but we all might have to package them up in places like the jniLibs directory ourselves :(. |
Also note that in my listing, I think on Android what would work well is to use the same "library short name" for all architectures and call A directory structure like this would work I think:
|
@irbull makes sense. Is there a way to package the entire lib so that it can be added as a dependency in gradle and have everything "just work" and the libs are in the correct |
@irbull So a couple of things:
Furthermore, I'm not sure where to find libj2v8_android_x86_64.so but even if I did, I don't think it will work because Library loader is explicitly loading libj2v8_android_armv7l.so. Does this make sense? Thanks all for your help! |
@achaudhry There are some fallback modes on Android. As @zhm mentioned So, I think what you need to do is create a jniLibs directory, and use the same directory structure mentioned above.
If there is anything in the jniLibs directory, then that takes precedence in the library loader and it will use that (it first tries a |
@irbull I see, makes sense! Sorry if this is a stupid question but, where can I get the .so files from? And where exactly am I creating the jniLibs directory i.e. what should be the package structure? Thanks |
OK awesome that worked!! 👍 👍 |
@irbull you can use remote 64-bit device, for example Samsung Galaxy S6, http://developer.samsung.com/remotetestlab/rtlDeviceList.action When will the new version in maven? Or I should build 64-bit version from source, right? |
This is working now, and I will be publishing binaries. This was mostly done in #384. Closing this as duplicate (even though this was opened first). |
Today you support only x86 and arm v7, devices with x86_64 for example can't run your code. Please add more jni libs for 64 bit..
This is the error I've got today:
Caused by: java.lang.UnsatisfiedLinkError: Could not load J2V8 library. Reasons:
Couldn't load j2v8_android_x86_64 from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.my-app.apk"],nativeLibraryDirectories=[/data/app-lib/com.my-app-2, /vendor/lib, /system/lib, /system/lib/arm]]]: findLibrary returned null
Thanks for this great site and support !!
Thanks a lot for this great library
The text was updated successfully, but these errors were encountered: