Android Question SQLite "not an error"

Rusty

Well-Known Member
Licensed User
Longtime User
I'm using an sqlcipher database v1.2 which is readable with an older program, but I'm trying to read the database with the test program from here .
Each time I try to open the database, it gives an error "Not an error" and the database won't open.
Any suggestions are greatly appreciated.


I've included the file icudt46l.zip in my assets; I've supplied the correct password (verified); I've included both libraries SQL and SQLCipher; when I try to open the file with:
B4X:
Dim SQL1 as SQLCipher
...

If SQL1.IsInitialized = False Then
        Try
            SQL1.initialize(SQLDataBasePath, SQLDateBaseName, False, SQLiteKey, File.DirAssets )
        Catch
            SQL1.initialize(SQLDataBasePath, SQLDateBaseName, False, "", File.DirAssets )
        End Try
    End If
I get the error message: Not an error
** Activity (main) Create, isFirst = true **
Error occurred on line: 129 (Main)
net.sqlcipher.database.SQLiteException: not an error
at net.sqlcipher.database.SQLiteDatabase.dbopen(Native Method)
at net.sqlcipher.database.SQLiteDatabase.<init>(SQLiteDatabase.java:1951)
at net.sqlcipher.database.SQLiteDatabase.openDatabase(SQLiteDatabase.java:901)
at net.sqlcipher.database.SQLiteDatabase.openDatabase(SQLiteDatabase.java:948)
at anyhwheresoftware.b4a.objects.sqlcipher.SQLCipher.Initialize(SQLCipher.java:51)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at anywheresoftware.b4a.shell.Shell.runVoidMethod(Shell.java:742)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:342)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:246)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:134)
at b4a.sqlitelight3.main.afterFirstLayout(main.java:102)
at b4a.sqlitelight3.main.access$000(main.java:17)
at b4a.sqlitelight3.main$WaitForLayout.run(main.java:80)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:149)
at android.app.ActivityThread.main(ActivityThread.java:5257)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:794)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:610)
at dalvik.system.NativeStart.main(Native Method)
 

Rusty

Well-Known Member
Licensed User
Longtime User
I have a "base" file in my assets folder that is an Encrypted SQLite database with no tables. I copy it to the final location and then create the tables.
In this program, I have copied the database with tables and data within to the final location. (currently this database is working in my main application).
I'm sure it is something I'm failing to do.

  1. Included libs SQL and SQLCipher
  2. assets contains the file icudt46l.zip
  3. Declared: Dim SQL1 as SQlCipher
  4. opened as above..
Is there something I'm forgetting? I've re-tested the database with an existing (production) program and it works fine.
Thanks Erel
 
Upvote 0
Top