Android Question SQLCipher runtime error(s)

alwaysbusy

Expert
Licensed User
Longtime User
I'm getting the following error when I use the lib (on Android 4.3) when I run the initialize:

B4X:
PackageAdded: package:com.gorgeousapps.quiqrun
** Activity (main) Create, isFirst = true **
prevBrightness=143
modglobal_loadparams (B4A line: 137)
SQL1.Initialize(iDir, iFile, True, v, "")
java.lang.UnsatisfiedLinkError: Couldn't load stlport_shared from loader dalvik.system.PathClassLoader[dexPath=/data/app/com.gorgeousapps.quiqrun-2.apk,libraryPath=/data/app-lib/com.gorgeousapps.quiqrun-2]: findLibrary returned null
    at java.lang.Runtime.loadLibrary(Runtime.java:355)
    at java.lang.System.loadLibrary(System.java:525)
    at net.sqlcipher.database.SQLiteDatabase.loadLibs(SQLiteDatabase.java:142)
    at net.sqlcipher.database.SQLiteDatabase.loadLibs(SQLiteDatabase.java:137)
    at anyhwheresoftware.b4a.objects.sqlcipher.SQLCipher.Initialize(SQLCipher.java:50)
    at com.gorgeousapps.quiqrun.modglobal._loadparams(modglobal.java:213)
    at com.gorgeousapps.quiqrun.main._activity_create(main.java:446)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:525)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:170)
    at com.gorgeousapps.quiqrun.main.afterFirstLayout(main.java:98)
    at com.gorgeousapps.quiqrun.main.access$100(main.java:16)
    at com.gorgeousapps.quiqrun.main$WaitForLayout.run(main.java:76)
    at android.os.Handler.handleCallback(Handler.java:730)
    at android.os.Handler.dispatchMessage(Handler.java:92)
    at android.os.Looper.loop(Looper.java:137)
    at android.app.ActivityThread.main(ActivityThread.java:5419)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:525)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1187)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
    at dalvik.system.NativeStart.main(Native Method)

B4X:
SQL1.Initialize(File.DirRootExternal, "/QuiQRun/codes.db", true, "Password", "") ' tried also file.dirAssets as last parameter

The following files are in my Libraries folder:
commons-codec.jar
guava-r09.jar
SQLCipher.jar
SQLCipher.xml
sqlcipher_native.jar

The file icudt46l.zip is in my /Files folder

I've read this tread several times but nobody seems to be getting this problem. Any Ideas?
 
Last edited:

alwaysbusy

Expert
Licensed User
Longtime User
Yes it does work. Even my compilation of dbutils works now (forgot to copy the icudt46l.zip file). In my program however I use another library I wrote who does also need .so files. My lib folder when I unzip the apk looks like this:

armeabi
- libdatabase_sqlcipher.so
- mine1.so
- libsqlcipher_android.so
- libstlport_shared.so
- mine2.so
armeabi-v7a
- mine1.so
- mine2.so

Maybe there is something here that is causing the problem? (Without the SQLCipher lib, the program works)
 
Last edited:
Upvote 0

alwaysbusy

Expert
Licensed User
Longtime User
This was indeed the error. When I removed the armeabi-v7a folder from my library and recompiled, it runs. Seems once android picked a system (armeabi or armeabi-v7a) it sticks with the libs in there and ignores the ones in the other folder. I hope this does not mean my library would not work optimized on some devices? I don't notice a difference in speed at this time, but if the native libs are split up, I would think it was for a reason.
 
Upvote 0
Top