How to compile jep for arm?

301 views Asked by At

I am trying to develop a new android app, and i kinda got into a dead end.
My app relies heavily on a popular python library (youtube-dl).
I did some research and i found out about Jep, which embeds python in java using JNI. With the library i could run python scripts from java code, which is exactly what i need.

I tried (without much hope) to use the given .jar and platform specific library (.dll , .so ), and added them to my android app as library and try to call it, but it makes the app crash with this following error:

08-17 08:41:26.323 7784-7784/com.example.david.app E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.david.app, PID: 7784
java.lang.UnsatisfiedLinkError: com.android.tools.fd.runtime.IncrementalClassLoader$DelegateClassLoader[DexPathList[[dex file "/data/data/com.example.david.app/files/instant-run/dex/slice-support-annotations-23.4.0_6d851d9a3cbbe5d1dac573180ea50da442a0ff00-classes.dex", dex file "/data/data/com.example.david.app/files/instant-run/dex/slice-slice_9-classes.dex", dex file "/data/data/com.example.david.app/files/instant-run/dex/slice-slice_8-classes.dex", dex file "/data/data/com.example.david.app/files/instant-run/dex/slice-slice_7-classes.dex", dex file "/data/data/com.example.david.app/files/instant-run/dex/slice-slice_6-classes.dex", dex file "/data/data/com.example.david.app/files/instant-run/dex/slice-slice_5-classes.dex", dex file "/data/data/com.example.david.app/files/instant-run/dex/slice-slice_4-classes.dex", dex file "/data/data/com.example.david.app/files/instant-run/dex/slice-slice_3-classes.dex", dex file "/data/data/com.example.david.app/files/instant-run/dex/slice-slice_2-classes.dex", dex file "/data/data/com.example.david.app/files/instant-run/dex/slice-slice_1-classes.dex", dex file "/data/data/com.example.david.app/files/instant-run/dex/slice-slice_0-classes.dex", dex file "/data/data/com.example.david.app/files/instant-run/dex/slice-jep-3.5.3_f02f85ba11a6b623a504a722d6d675f3916fbad2-classes.dex", dex file "/data/data/com.example.david.app/files/instant-run/dex/slice-internal_impl-23.4.0_17f1606a4177dabe6c6459fef4a647cc09a8d4a2-classes.dex", dex file "/data/data/com.example.david.app/files/instant-run/dex/slice-instant-run_25d13f3103c85cc8587c7242c22774f6eb360c23-classes.dex", dex file "/data/data/com.example.david.app/files/instant-run/dex/slice-instant-run-bootstrap_18b4f46f105b17869f88f950a22298ce35e60199-classes.dex", dex file "/data/data/com.example.david.app/files/instant-run/dex/slice-com.android.support-support-vector-drawable-23.4.0_b9a1f0b67bddb638f672d79083f55605807f0183-classes.dex", dex file "/data/data/com.example.david.app/files/instant-run/dex/slice-com.android.support-support-v4-23.4.0_23798b62923b0a9c9033d72c0147e777ccfe1c4a-classes.dex", dex file "/data/data/com.example.david.app/files/instant-run/dex/slice-com.android.support-appcompat-v7-23.4.0_cd9016a3c981ed8ed409576c975226d0ed4d587d-classes.dex", dex file "/data/data/com.example.david.app/files/instant-run/dex/slice-com.android.support-animated-vector-drawable-23.4.0_f4f79f21b3754baabcc99a1c7ebcf721372ecb14-classes.dex"],nativeLibraryDirectories=[/data/app/com.example.david.app-1/lib/x86, /vendor/lib, /system/lib]]] couldn't find "libjep.so"
    at java.lang.Runtime.loadLibrary(Runtime.java:367)
    at java.lang.System.loadLibrary(System.java:1076)
    at jep.Jep$TopInterpreter$1.run(Jep.java:118)
    at java.lang.Thread.run(Thread.java:818)

My libs contain:

  • jep-3.5.3.jar
  • jep.so
  • libjep.so

And in my build.gradle i set to include all .jar/.so files:

compile fileTree(dir: 'libs', include: ['.jar','.so'])  

Worth noting i did the same with the windows build (jep.dll instead of .so) and got the same error.

It's probably failing because it was build on ubuntu 16.04/Windows 10 on jdk 7. My question is which compiler should i use in order to build this Jep for arm/x86 devices ? Its a Java project with native C calls with JNI,and in the project they stated that its possible to run it on android.

Thanks for any help, i have no experience in compiling project for certain architecture, so i came here to ask.

0

There are 0 answers