如何为arm编译jep?

时间:2016-08-17 08:55:04

标签: java android python arm jepp

我正在尝试开发一个新的Android应用程序,我有点陷入死胡同 我的应用程序很大程度上依赖于一个流行的python库(youtube-dl) 我做了一些研究,我发现了Jep,它使用JNI在java中嵌入python。使用库我可以从java代码运行python脚本,这正是我需要的。

我尝试(没有太多希望)使用给定的.jar和平台特定库(.dll,.so),并将它们添加到我的Android应用程序作为库并尝试调用它,但它使应用程序崩溃以下错误:

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)

我的图书馆包含:

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

在我的build.gradle中,我设置包含所有.jar / .so文件:

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

值得注意的是我对windows build(jep.dll而不是.so)做了同样的事情并得到了同样的错误。

它可能失败了,因为它是在jdk 7上的ubuntu 16.04 / Windows 10上构建的。 我的问题是我应该使用哪个编译器来为arm / x86设备构建这个Jep?它是一个Java项目,使用JNI进行本机C调用,在项目中他们表示可以在android上运行它。

感谢您的帮助,我没有为某些架构编译项目的经验,所以我来这里问。

0 个答案:

没有答案
相关问题