Android Question Sqlcipher not work with sdk 28

Sberla

Active Member
Licensed User
Longtime User
Hi, I'm using the SQLCipher class taken from this thread

https://www.b4x.com/android/forum/threads/android-database-encryption-with-sqlcipher-library.14965/

I downloaded version V1.60 but with an error

** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
sending message to waiting queue (activity_permissionresult)
running waiting messages (1)
java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader [DexPathList [[zip file "/data/app/it.test.test-Jyuc_E_8DInjZPrO2wue9Q==/base.apk"],nativeLibraryDirectories=[/data/app/it.test .test-Jyuc_E_8DInjZPrO2wue9Q == / lib / arm64, / system / lib64, / system / vendor / lib64]]] couldn't find "libsqlcipher.so"
at java.lang.Runtime.loadLibrary0 (Runtime.java:1012)
at java.lang.System.loadLibrary (System.java:1669)
at net.sqlcipher.database.SQLiteDatabase $ 1.loadLibraries (SQLiteDatabase.java:219)
at net.sqlcipher.database.SQLiteDatabase.loadLibs (SQLiteDatabase.java:236)
at net.sqlcipher.database.SQLiteDatabase.loadLibs (SQLiteDatabase.java:215)
at net.sqlcipher.database.SQLiteDatabase.loadLibs (SQLiteDatabase.java:208)
at anyhwheresoftware.b4a.objects.sqlcipher.SQLCipher.Initialize (SQLCipher.java:51)
at it.test.test.database._startdb (database.java:90)
at it.test.test.main._activity_permissionresult (main.java:836)
at java.lang.reflect.Method.invoke (Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod (Shell.java:710)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl (Shell.java:342)
at anywheresoftware.b4a.shell.Shell.raiseEvent (Shell.java:249)
at java.lang.reflect.Method.invoke (Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2 (ShellBA.java:139)
at anywheresoftware.b4a.BA $ 2.run (BA.java:360)
at anywheresoftware.b4a.BA.setActivityPaused (BA.java:432)
at it.test.test.main $ ResumeMessage.run (main.java:305)
at android.os.Handler.handleCallback (Handler.java:873)
at android.os.Handler.dispatchMessage (Handler.java:99)
at android.os.Looper.loop (Looper.java:214)
at android.app.ActivityThread.main (ActivityThread.java:7045)

i am using sdk 28 and it does not work

AddManifestText(
<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="28"/>
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>)

what can I do?
 
Last edited:

OliverA

Expert
Licensed User
Longtime User
Did you download the additional AAR file as instructed? Did you place it in the additional libraries folder?
 
Upvote 0

Sberla

Active Member
Licensed User
Longtime User
Did you download the additional AAR file as instructed? Did you place it in the additional libraries folder?
I downloaded it and put it in the b4a libraries.
I published the first version of my app on the playstore with <uses-sdk android: minSdkVersion = "9" android: targetSdkVersion = "28" />, I can put a lower sdk even if the first version of the app is at targetSdkVersion = " 28 "?
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
if you already published a app with sdk 28 then you can not go back. As far as i know.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

Sberla

Active Member
Licensed User
Longtime User
@Erel if i put old sdk the Library only works by putting sdk 28 generate this error someone could post me the Library for sdk 28 ?
Thanks
 
Upvote 0

Sberla

Active Member
Licensed User
Longtime User
Gives me this error:

java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/it.test.test-b9ucT2crosDLUKvNhQcB3A==/base.apk"],nativeLibraryDirectories=[/data/app/it.test.test-b9ucT2crosDLUKvNhQcB3A==/lib/arm64, /system/lib64, /system/vendor/lib64]]] couldn't find "libsqlcipher.so"
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
test.apk is only 185kb? I guess it is missing the AAR file.

After i copied the file from

SQLCipher v1.6+ depends on an additional AAR file: http://central.maven.org/maven2/net...er/4.0.0/android-database-sqlcipher-4.0.0.aar

to my additional libs folder and do a recompile the apk is >6mb is size....

I suggest to download this file, put it in your additional library folder, clean your project and recompile it. The apk must grow in size much...
 
Last edited:
Upvote 0

Sberla

Active Member
Licensed User
Longtime User
test.apk is only 185kb? I guess it is missing the AAR file.

After i copied the file from

SQLCipher v1.6+ depends on an additional AAR file: http://central.maven.org/maven2/net...er/4.0.0/android-database-sqlcipher-4.0.0.aar

to my additional libs folder and do a recompile the apk is >6mb is size....

I suggest to download this file, put it in your additional library folder, clean your project and recompile it. The apk must grow in size much...

where should I insert the .aar file? how is it included?
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Last edited:
Upvote 0

Sberla

Active Member
Licensed User
Longtime User
I wrote it multiple times now
https://www.b4x.com/android/forum/threads/sqlcipher-not-work-with-sdk-28.111379/#post-694733

Oliver told it to you too

In the ADDITIONAL LIBRARY Folder. That is the path you set in the configuration of the IDE (path for additional libraries).

Check this Tutorial:
https://www.b4x.com/android/forum/threads/b4x-additional-libraries-folder.103165/

I tried but it doesn't work, it always gives me the same error, I don't know what I'm wrong. He tells me there is no library:

java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader [DexPathList [[zip file "/data/app/it.test.test-b9ucT2crosDLUKvNhQcB3A==/base.apk"],nativeLibraryDirectories=[/data/app/it.test .test-b9ucT2crosDLUKvNhQcB3A == / lib / arm64, / system / lib64, / system / vendor / lib64]]] couldn't find "libsqlcipher.so"

With the old version of sqlcipher it works fine, but I have to publish on the playstore with the sdk 28, so I have to use the new version of the sqlcipher library right? I can't get it to work.

I have inserted the file SQLCipher.jar, SQLCipher.xml and android-database-sqlcipher-4.0.0.aar in the folder C: Program Files (x86) Anywhere Software Basic4android Libraries

But it doesn't work, what can I do?
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
I have inserted the file SQLCipher.jar, SQLCipher.xml and android-database-sqlcipher-4.0.0.aar in the folder C: Program Files (x86) Anywhere Software Basic4android Libraries

But it doesn't work, what can I do?
Never copy additional libraries to the internal folder. Delete all of them. Configure the additional libraries folder under Tools - Configure Paths and set it to a folder under the Documents folder.

Copy all the additional libraries to the additional libraries folder.
 
Upvote 0

Sberla

Active Member
Licensed User
Longtime User
Never copy additional libraries to the internal folder. Delete all of them. Configure the additional libraries folder under Tools - Configure Paths and set it to a folder under the Documents folder.

Copy all the additional libraries to the additional libraries folder.

I did a test and saw that with version 9.30 of b4a it works correctly using SQL Cipher vers 1.60
 
Upvote 0
Top