Android Question Applying sqlcipher-android-4.10.0.aar that fixes 16KB issues with SQLCipher

Alex_197

Well-Known Member
Licensed User
Longtime User
Hi all.

Thanks to @GeoffT660 , @Shelby and @DonManfred we now can download a replacement for SQLCipher aar that will allow us to continue using it with 16KB requirements.

I did some tests on my test computer - here is a result.

I just in case first archived my AdditionalLib folder in case if something will go wrong.

I removed existing files such as

android-database-sqlcipher-4.0.0.aar
android-database-sqlcipher-4.2.0.aar
android-database-sqlcipher-4.5.4.aar

Then I downloaded sqlcipher-android-4.10.0.aar from https://repo1.maven.org/maven2/net/zetetic/sqlcipher-android/4.10.0/ and put it into my AdditionalLib folder.

Opened B4A, opened my project and tried to compile it. It didn't work - the B4A says that can't find android-database-sqlcipher-4.5.4.aar file. I run the search in AdditionalLib folder to see what file has a reference to android-database-sqlcipher-4.5.4.aar. It was SQLCipher.xml. Opened it and at the very bottom there is a line
B4X:
 <dependsOn>android-database-sqlcipher-4.5.4.aar</dependsOn>

I replaced it with sqlcipher-android-4.10.0.aar. Tried to compile it again - so far so good.

I did it on my test computer which is located in a different place (connected via remote desktop) so I didn't actually ran my project on the app.

My question is - did I miss something else or not?
 

Shelby

Well-Known Member
Licensed User
Longtime User
My only question is, "Did you remove the sqlite-2.4.0 file? That's the file I mentioned which had a name differing from the sqlcifer files we were discussing in the other thread.
 
Upvote 0

Alex_197

Well-Known Member
Licensed User
Longtime User
Upvote 0

mcqueccu

Well-Known Member
Licensed User
Longtime User
Not working for me.
I downloaded the sqlcipher-android-4.10.0.aar and placed in the additional libraries folder, same place as the sqlcipher.xml

I edited the Depends on from: <dependsOn>android-database-sqlcipher-4.5.4.aar</dependsOn>

to this: <dependsOn>sqlcipher-android-4.10.0.aar</dependsOn>

Saved and Refresh my libraries tab. But when I compiled I get this error

** Activity (main) Create (first time) **
java.lang.NoClassDefFoundError: Failed resolution of: Lnet/sqlcipher/database/SQLiteDatabase;
at anyhwheresoftware.b4a.objects.sqlcipher.SQLCipher.Initialize(SQLCipher.java:51)
at b4a.example.main._activity_create(main.java:401)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:348)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:157)
at b4a.example.main.afterFirstLayout(main.java:105)
at b4a.example.main.access$000(main.java:17)
at b4a.example.main$WaitForLayout.run(main.java:83)
at android.os.Handler.handleCallback(Handler.java:959)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loopOnce(Looper.java:232)
at android.os.Looper.loop(Looper.java:317)
at android.app.ActivityThread.main(ActivityThread.java:8705)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:580)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:886)
Caused by: java.lang.ClassNotFoundException: net.sqlcipher.database.SQLiteDatabase
... 19 more
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = true **
 
Upvote 0

Shelby

Well-Known Member
Licensed User
Longtime User
Gee, how disappointing. It's beyond my abilities to help so my guess is that you might start a new thread to attract the attention of some brainy members. Good luck
 
Upvote 0

Alex_197

Well-Known Member
Licensed User
Longtime User
It's just came to my mind- what if we will update
Not working for me.
I downloaded the sqlcipher-android-4.10.0.aar and placed in the additional libraries folder, same place as the sqlcipher.xml

I edited the Depends on from: <dependsOn>android-database-sqlcipher-4.5.4.aar</dependsOn>

to this: <dependsOn>sqlcipher-android-4.10.0.aar</dependsOn>

Saved and Refresh my libraries tab. But when I compiled I get this error

** Activity (main) Create (first time) **
java.lang.NoClassDefFoundError: Failed resolution of: Lnet/sqlcipher/database/SQLiteDatabase;
at anyhwheresoftware.b4a.objects.sqlcipher.SQLCipher.Initialize(SQLCipher.java:51)
at b4a.example.main._activity_create(main.java:401)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:348)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:157)
at b4a.example.main.afterFirstLayout(main.java:105)
at b4a.example.main.access$000(main.java:17)
at b4a.example.main$WaitForLayout.run(main.java:83)
at android.os.Handler.handleCallback(Handler.java:959)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loopOnce(Looper.java:232)
at android.os.Looper.loop(Looper.java:317)
at android.app.ActivityThread.main(ActivityThread.java:8705)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:580)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:886)
Caused by: java.lang.ClassNotFoundException: net.sqlcipher.database.SQLiteDatabase
... 19 more
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = true **
Did you try to close the B4A and open again?
 
Upvote 0

popeyes44

Member
Hi

Same error as @mcqueccu
It's possible to give us :
- which folder you use for your additional libraries (additional libraries seems to accept only jar file so i suppose it's in B4A officiel folder - C:\Program Files\Anywhere Software\B4A\Libraries - ?)
- files you use (XML + aar) ?

Thanks
 
Upvote 0

Alex_197

Well-Known Member
Licensed User
Longtime User
Hi

Same error as @mcqueccu
It's possible to give us :
- which folder you use for your additional libraries (additional libraries seems to accept only jar file so i suppose it's in B4A officiel folder - C:\Program Files\Anywhere Software\B4A\Libraries - ?)
- files you use (XML + aar) ?

Thanks
please see the screenshots of my additionallib folder and the sqlcipher.xml
 

Attachments

  • AdditionalLib.png
    AdditionalLib.png
    112.5 KB · Views: 15
  • xml.png
    xml.png
    56.3 KB · Views: 15
Upvote 0

Alex_197

Well-Known Member
Licensed User
Longtime User
Hi

Same error as @mcqueccu
It's possible to give us :
- which folder you use for your additional libraries (additional libraries seems to accept only jar file so i suppose it's in B4A officiel folder - C:\Program Files\Anywhere Software\B4A\Libraries - ?)
- files you use (XML + aar) ?

Thanks
just in case - my sqlcipher version is 1.70
 

Attachments

  • libs.png
    libs.png
    11.5 KB · Views: 14
Upvote 0

Alex_197

Well-Known Member
Licensed User
Longtime User
Upvote 0

Alex_197

Well-Known Member
Licensed User
Longtime User
Not working for me.
I downloaded the sqlcipher-android-4.10.0.aar and placed in the additional libraries folder, same place as the sqlcipher.xml

I edited the Depends on from: <dependsOn>android-database-sqlcipher-4.5.4.aar</dependsOn>

to this: <dependsOn>sqlcipher-android-4.10.0.aar</dependsOn>

Saved and Refresh my libraries tab. But when I compiled I get this error

** Activity (main) Create (first time) **
java.lang.NoClassDefFoundError: Failed resolution of: Lnet/sqlcipher/database/SQLiteDatabase;
at anyhwheresoftware.b4a.objects.sqlcipher.SQLCipher.Initialize(SQLCipher.java:51)
at b4a.example.main._activity_create(main.java:401)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:348)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:157)
at b4a.example.main.afterFirstLayout(main.java:105)
at b4a.example.main.access$000(main.java:17)
at b4a.example.main$WaitForLayout.run(main.java:83)
at android.os.Handler.handleCallback(Handler.java:959)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loopOnce(Looper.java:232)
at android.os.Looper.loop(Looper.java:317)
at android.app.ActivityThread.main(ActivityThread.java:8705)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:580)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:886)
Caused by: java.lang.ClassNotFoundException: net.sqlcipher.database.SQLiteDatabase
... 19 more
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = true **
check this https://www.b4x.com/android/forum/threads/sqlcipher-4-5-4-update.152692/
 
Upvote 0

popeyes44

Member
I downloadaed a fresh version of 1.70 SQLCipher lmib and put it in my additional library folder. I donwload 4.10.0 aar file and put it in same directory, modify the WML (I have the 2 lines depends on) and If I use 4.10.0; I always have the issue but not with the old (4.5.4). Tested on a fresh new app so can't understand why that work for you and not for me ;-)

issue is : "java.lang.NoClassDefFoundError: Failed resolution of: Lnet/sqlcipher/database/SQLiteDatabase;"

Tested :
- remove "<dependsOn>sqlite-2.4.0.aar</dependsOn>" and use 4.5.4 : issue
- keep "<dependsOn>sqlite-2.4.0.aar</dependsOn>" and use 4.5.4 : valid
- remove "<dependsOn>sqlite-2.4.0.aar</dependsOn>" and use 4.10.0 : issue
- keep "<dependsOn>sqlite-2.4.0.aar</dependsOn>" and use 4.10.0 : issue

I use the simply app joined, have an issue just after "Log("test4")" :

B4X:
Sub Process_Globals
    Public ActionBarHomeClicked As Boolean
    Dim mydb As SQLCipher
End Sub

Sub Globals

End Sub

Sub Activity_Create(FirstTime As Boolean)
    Dim pm As B4XPagesManager
    Dim fichier As String
    pm.Initialize(Activity)
    fichier="mydb.dat"
Log("test1")   
    If File.Exists(File.DirInternal,fichier) = True Then
        Log("test2")
        mydb.Initialize(File.DirInternal,fichier,True,"nopass","")
        Log("test3")
    Else
        Log("test4")
        [B]mydb.Initialize(File.DirInternal, fichier,True,"nopass","")[/B]
        Log("test5")
        mydb.ExecNonQuery("CREATE TABLE IF NOT EXISTS configuration (id TEXT(20) NOT NULL, valeur TEXT(255))")
        Log("test6")
    End If
End Sub
 

Attachments

  • B4A.zip
    3.5 KB · Views: 5
Upvote 0

Alex_197

Well-Known Member
Licensed User
Longtime User
I downloadaed a fresh version of 1.70 SQLCipher lmib and put it in my additional library folder. I donwload 4.10.0 aar file and put it in same directory, modify the WML (I have the 2 lines depends on) and If I use 4.10.0; I always have the issue but not with the old (4.5.4). Tested on a fresh new app so can't understand why that work for you and not for me ;-)

issue is : "java.lang.NoClassDefFoundError: Failed resolution of: Lnet/sqlcipher/database/SQLiteDatabase;"

Tested :
- remove "<dependsOn>sqlite-2.4.0.aar</dependsOn>" and use 4.5.4 : issue
- keep "<dependsOn>sqlite-2.4.0.aar</dependsOn>" and use 4.5.4 : valid
- remove "<dependsOn>sqlite-2.4.0.aar</dependsOn>" and use 4.10.0 : issue
- keep "<dependsOn>sqlite-2.4.0.aar</dependsOn>" and use 4.10.0 : issue

I use the simply app joined, have an issue just after "Log("test4")" :

B4X:
Sub Process_Globals
    Public ActionBarHomeClicked As Boolean
    Dim mydb As SQLCipher
End Sub

Sub Globals

End Sub

Sub Activity_Create(FirstTime As Boolean)
    Dim pm As B4XPagesManager
    Dim fichier As String
    pm.Initialize(Activity)
    fichier="mydb.dat"
Log("test1")  
    If File.Exists(File.DirInternal,fichier) = True Then
        Log("test2")
        mydb.Initialize(File.DirInternal,fichier,True,"nopass","")
        Log("test3")
    Else
        Log("test4")
        [B]mydb.Initialize(File.DirInternal, fichier,True,"nopass","")[/B]
        Log("test5")
        mydb.ExecNonQuery("CREATE TABLE IF NOT EXISTS configuration (id TEXT(20) NOT NULL, valeur TEXT(255))")
        Log("test6")
    End If
End Sub
check this https://www.b4x.com/android/forum/threads/sqlcipher-4-5-4-update.152692/

Please download and add into Main this line

B4X:
#AdditionalJar: sqlite-2.4.0.aar

this file came from this zip https://www.b4x.com/android/forum/t...ryption-with-sqlcipher-library.14965/#content

I think that you might be missing this https://www.b4x.com/android/forum/t...th-sqlcipher-library.14965/page-9#post-980021 and this https://www.b4x.com/android/forum/threads/xsqlcipher-for-android-sqlcipher-4-5-4.159584/#post-979787
 
Upvote 0

popeyes44

Member

Already tested (and probably not necessary as "<dependsOn>sqlite-2.4.0.aar</dependsOn>" already exist on my sqlcypher.xml file).

Also tested : use of last version (sqlite-android-3500400.aar) but no more lucky...
 
Upvote 0
Top