添加和QUOT;。所以&​​QUOT;库到Android Studio项目 [英] Adding ".so" library to my android studio project

查看:315
本文介绍了添加和QUOT;。所以&​​QUOT;库到Android Studio项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有问题时,我尝试将spatialite数据库添加到我的Andr​​oid工作室projet.I遵循本教程中的https://www.gaia-gis.it/fossil/libspatialite/wiki?name=spatialite-android-tutorial如前所述我添加了两个文件夹到我的项目:

I am having issues when i try to add a spatialite database to my android studio projet.I followed this tutorial https://www.gaia-gis.it/fossil/libspatialite/wiki?name=spatialite-android-tutorial , as mentioned i added two folders to my project :


  1. 本机spatialite库:他们是在我的应用程序目录中的文件夹中名为库的地方,包含几个文件夹持有主库不同的平台,叫libspatialite.so

  1. the native spatialite libraries: they are places in a folder named libs in my App directory and contains several folders for different platforms that hold the main library, called libspatialite.so

基本的API类,包含在jsqlite包

the basic API classes, contained in the jsqlite package

尽管这样,我得到这个错误:

Despite this ,i am getting this error :

11-13 13:52:17.358    1853-1853/liara.geodatamining W/System.err﹕ Unable to load sqlite_jni: java.lang.UnsatisfiedLinkError: Couldn't load proj from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/liara.geodatamining-2.apk"],nativeLibraryDirectories=[/data/app-lib/liara.geodatamining-2, /system/lib]]]: findLibrary returned null
11-13 13:52:17.358    1853-1853/liara.geodatamining W/dalvikvm﹕ No implementation found for native Ljsqlite/Database;.internal_init:()V
11-13 13:52:17.358    1853-1853/liara.geodatamining W/dalvikvm﹕ Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing Ljsqlite/Database;
11-13 13:52:17.358    1853-1853/liara.geodatamining W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0xb2d19b20)
11-13 13:52:17.358    1853-1853/liara.geodatamining E/AndroidRuntime﹕ FATAL EXCEPTION: main
    Process: liara.geodatamining, PID: 1853
    java.lang.UnsatisfiedLinkError: Native method not found: jsqlite.Database.internal_init:()V
            at jsqlite.Database.internal_init(Native Method)
            at jsqlite.Database.<clinit>(Database.java:951)
            at liara.geodatamining.map.onCreate(map.java:116)
            at android.app.Activity.performCreate(Activity.java:5231)
            at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
            at android.app.ActivityThread.access$800(ActivityThread.java:135)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            at android.os.Looper.loop(Looper.java:136)
            at android.app.ActivityThread.main(ActivityThread.java:5017)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:515)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
            at dalvik.system.NativeStart.main(Native Method)  

我缺少的东西?

Am i missing something ?

推荐答案

如果你只使用.so文件,而不是任何编译的C / C ++源代码自己,你不需要NDK。

if you're only using .so files and not compiling any C/C++ sources yourself, you don't need the NDK.

使用Android的工作室,在那里你把.so文件不大于与Eclipse相同的地方。现在是 jniLibs /&LT内部; ABI&GT; 其中ABI可以的 armeabi armeabi-V7A 86 x86_64的 MIPS MIPS64 arm64-V8A

With Android Studio, the place where you drop .so files isn't the same than with eclipse. Now it's inside jniLibs/<ABI> where ABI can be armeabi, armeabi-v7a, x86, x86_64, mips, mips64, arm64-v8a.

您可以检查你的.so文件被正确打开您的APK作为一个zip文件,然后直接检查你的.so文件都在里面的lib /&LT集成; ABI&GT; 文件夹。

You can check that your .so files are properly integrated by opening your APK as a zip file and simply checking that your .so files are inside lib/<abi> folders.

这篇关于添加和QUOT;。所以&​​QUOT;库到Android Studio项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆