Android Question Sqlcipher not work with sdk 28

Discussion in 'Android Questions' started by Sberla, Nov 14, 2019.

  1. Sberla

    Sberla Active Member Licensed 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: Nov 15, 2019
  2. OliverA

    OliverA Expert Licensed User

    Did you download the additional AAR file as instructed? Did you place it in the additional libraries folder?
     
  3. Sberla

    Sberla Active Member Licensed User

    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 "?
     
  4. DonManfred

    DonManfred Expert Licensed User

    if you already published a app with sdk 28 then you can not go back. As far as i know.
     
  5. Sberla

    Sberla Active Member Licensed User

    sdk who accepts the playstore as it is now?
     
  6. DonManfred

    DonManfred Expert Licensed User

  7. Sberla

    Sberla Active Member Licensed 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
     
  8. Sberla

    Sberla Active Member Licensed 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"
     
  9. Erel

    Erel Administrator Staff Member Licensed User

  10. Sberla

    Sberla Active Member Licensed User

    Attached Files:

  11. Erel

    Erel Administrator Staff Member Licensed User

    Please create an APK with SQLCipher and upload it (use Google drive or a similar service).
     
  12. Sberla

    Sberla Active Member Licensed User

  13. DonManfred

    DonManfred Expert Licensed 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: Nov 18, 2019
    Erel likes this.
  14. Sberla

    Sberla Active Member Licensed User

    where should I insert the .aar file? how is it included?
     
  15. DonManfred

    DonManfred Expert Licensed User

    Last edited: Nov 18, 2019
  16. Sberla

    Sberla Active Member Licensed User

    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?
     
  17. DonManfred

    DonManfred Expert Licensed User

    Give me your AnyDesc id and i´ll connect to your pc and help you checking it...
     
  18. Erel

    Erel Administrator Staff Member Licensed 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.
     
  19. Sberla

    Sberla Active Member Licensed User

    I did a test and saw that with version 9.30 of b4a it works correctly using SQL Cipher vers 1.60
     
  20. Erel

    Erel Administrator Staff Member Licensed User

    It is not related to B4A version. Your libraries are not configured properly.
     
    OliverA likes this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice