SQLCipher Problem.....

DouglasNYoung

Active Member
Licensed User
Longtime User
Probably something really obvious, but I'm struggling to locate the problem-

- My laptop disk died catastrophically, so I've moved B4A onto a desktop and upgraded to V2.71 at the same time.
- On compiling an existing project, I don't get any errors, but when it installs to a device I get "Unfortunately TM Toolkit has stopped" and the log shows:-

B4X:
** Activity (main) Create, isFirst = true **
main_activity_create (B4A line: 216)
sqlcipherdata.Initialize(File.DirDefaultExternal, "_grj.db", True, dbpassword, File.DirAssets  )
java.lang.NoClassDefFoundError: info/guardianproject/database/CursorWindow
   at java.lang.Runtime.nativeLoad(Native Method)
   at java.lang.Runtime.load(Runtime.java:338)
   at java.lang.System.load(System.java:521)
   at anyhwheresoftware.b4a.objects.sqlcipher.SQLCipher.Initialize(SQLCipher.java:45)
   at dny.tmtoolkit.main._activity_create(main.java:373)
   at java.lang.reflect.Method.invokeNative(Native Method)
   at java.lang.reflect.Method.invoke(Method.java:511)
   at anywheresoftware.b4a.BA.raiseEvent2(BA.java:169)
   at dny.tmtoolkit.main.afterFirstLayout(main.java:89)
   at dny.tmtoolkit.main.access$100(main.java:16)
   at dny.tmtoolkit.main$WaitForLayout.run(main.java:74)
   at android.os.Handler.handleCallback(Handler.java:615)
   at android.os.Handler.dispatchMessage(Handler.java:92)
   at android.os.Looper.loop(Looper.java:155)
   at android.app.ActivityThread.main(ActivityThread.java:5454)
   at java.lang.reflect.Method.invokeNative(Native Method)
   at java.lang.reflect.Method.invoke(Method.java:511)
   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1029)
   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:796)
   at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NoClassDefFoundError: info/guardianproject/database/sqlcipher/SQLiteStatement
   ... 20 more
Caused by: java.lang.NoClassDefFoundError: info/guardianproject/database/sqlcipher/SQLiteProgram
   ... 20 more
Caused by: java.lang.NoClassDefFoundError: info/guardianproject/database/sqlcipher/SQLiteQuery
   ... 20 more
Caused by: java.lang.NoClassDefFoundError: info/guardianproject/database/sqlcipher/SQLiteCompiledSql
   ... 20 more
Caused by: java.lang.NoClassDefFoundError: info/guardianproject/database/sqlcipher/SQLiteDatabase
   ... 20 more
Caused by: java.lang.ClassNotFoundException: info.guardianproject.database.sqlcipher.SQLiteDatabase
   at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
   ... 20 more

The offending line 216 is:-
B4X:
sqlcipherdata.Initialize(File.DirDefaultExternal, "_grj.db", True, dbpassword, File.DirAssets  )
As far as I can see I've installed everything correctly as per the SQLCipher Tutorial.

Any ideas?

Thanks in advance,
Douglas
 

DouglasNYoung

Active Member
Licensed User
Longtime User
Erel,
Yes - I've downloaded the latest library files and refreshed the SQLCipher.zip in the project just in case that was the problem...

Douglas
 
Upvote 0

DouglasNYoung

Active Member
Licensed User
Longtime User
No that didn't work - got the exact same error - tried it on an HTC ONE S and on a Samsung Galaxy Tab 2 7" and get the same error on both!

Totally confused!

Douglas
 
Upvote 0

DouglasNYoung

Active Member
Licensed User
Longtime User
Erel,
SQLCipher version is 1.10 and the SQLCipher.zip in the Files Tab has been refreshed to ensure that there wasn't incompatibility there.

In a bid to get moving I installed B4A on my wife's portable, and I'm still getting the same error(s) - Now I'm really bamboozled!

Since I haven't changed any code in the source file, the problem can't be there; It compiles OK, without errors, so that should be OK too; The app has been installed on both phone & tablet before so that shouldn't be a problem either; but the error is clearly in SQLCipher, but where?

Could I perhaps PM you a zipped copy of the project an see if it compiles and runs for you, then we'd know it is something in my setup?

Regards,
Douglas
[email protected]
 
Upvote 0

coyote

Member
Licensed User
Longtime User
Hi, I get the same Error Message.

B4X:
java.lang.NoClassDefFoundError: info/guardianproject/database/CursorWindow

Erel, did you find a solution?

My system is fresh installed and I just want to create a test db.

B4X:
Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.
    Dim StorageDB As SQLCipher
End Sub

Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.
   
End Sub

Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    'Activity.LoadLayout("Layout1")
    StorageDB.Initialize(File.DirInternal, "test.db", True, "xy", File.DirAssets)
   
End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub

SQLCiper V1.10 is used and the *nativ.zip was added.



Thanks, Coyote
 
Upvote 0

DouglasNYoung

Active Member
Licensed User
Longtime User
Erel,
Yes - I was starting to experiment along the same lines.....
- It seems that if I recompile with a different package name then it will work OK.
- If I have the same package name the sqlcipher_native.zip file is already initialized, but with v1.0 of the zip file which throws up the error!

I can't see any way of un-intializing the sqlcipher_native.zip file to install the new version - I suspect that I will have to issue the next version of the app with a different package name and delete the old app, programatically if possible, or manuall if need be!

Any other ideas?

Thanks for the guidance,
Douglas

PS - It seem amazing that nobody else has come across this!
 
Upvote 0
Top