2

I have a requirement to retrieve larger images which is limited by Cursor limit(1 Mb) in android's native sqlite support.

I am trying to use sqlite4java in my android studio project but am facing issues loading the native library.

My project libs(C:\Users\admin\AndroidStudioProjects\appname\libs) folder has the following files:

enter image description here

 armeabi\libsqlite4java-android-armv5tejl.so
 armeabi-v7a\libsqlite4java-android-armv7l.so
 x86\libsqlite4java-android-i686.so
 libsqlite4java-linux-amd64.so
 libsqlite4java-linux-i386.so
 libsqlite4java-osx.dylib
 sqlite4java.jar
 sqlite4java-docs.zip
 sqlite4java-src.zip
 sqlite4java-win32-x64.dll
 sqlite4java-win32-x86.dll

When I run the command "java -jar sqlite4java.jar" on the Terminal:

I get the error:

Error: Unable to access jarfile sqlite4java.jar

Nonetheless I can use the classes in my code; but when I try to open a database connection I get the exception:

com.almworks.sqlite4java.SQLiteException: [-91] cannot load library:java.lang.UnsatisfiedLinkError:dalvik.system.PathClassLoader[DexPathList[[zip file"/data/app/diary.appname-2/base.apk"],nativeLibraryDirectories=[/vendor/lib,/system/lib]]]couldn't find "libsqlite4java-android-armv7l.so"

"libsqlite4java-android-armv7l.so" is already present in the folder "libs\armeabi-v7a".

What can I do to use sqlite4java in my project?

asked Mar 13, 2015 at 20:54
2
  • How are you importing the jar into your project? Commented Mar 14, 2015 at 14:41
  • Added it in the project libs folder and right click to add to Library Commented Mar 14, 2015 at 17:30

1 Answer 1

2

I finally found a solution.

I've made a lib(not libs) folder and inside it I've moved the folders armeabi, armeabi-v7a and x86.

I then zipped the lib folder into lib.zip, renamed it to armeabi.lib and converted it to .jar.

This I've placed in My project libs(C:\Users\admin\AndroidStudioProjects\appname\libs) folder:

 armeabi.jar
 libsqlite4java-linux-amd64.so
 libsqlite4java-linux-i386.so
 libsqlite4java-osx.dylib
 sqlite4java.jar
 sqlite4java-docs.zip
 sqlite4java-src.zip
 sqlite4java-win32-x64.dll
 sqlite4java-win32-x86.dll

armeabi.jar has the lib folder.

answered Mar 22, 2015 at 7:20
Sign up to request clarification or add additional context in comments.

1 Comment

how can convert armeabi.lib to .jar. by rename?

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.