Android : sqlcipher - net.sqlcipher.database.SQLiteException: not an error

on Sunday, July 27, 2014


I'm using sqlcipher for encoding my database . I've added the libraries and jar files and it works fine on api 18 and 16 but It gives me this error on api 11 :



java.lang.RuntimeException: Unable to start activity ComponentInfo{}: net.sqlcipher.database.SQLiteException: not an error
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1651)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)
at android.app.ActivityThread.access$1500(ActivityThread.java:117)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3687)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625)
at dalvik.system.NativeStart.main(Native Method)

Caused by: net.sqlcipher.database.SQLiteException: not an error
at net.sqlcipher.database.SQLiteDatabase.dbopen(Native Method)
at net.sqlcipher.database.SQLiteDatabase.<init>(SQLiteDatabase.java:1942)
at net.sqlcipher.database.SQLiteDatabase.openDatabase(SQLiteDatabase.java:875)
at net.sqlcipher.database.SQLiteDatabase.openDatabase(SQLiteDatabase.java:868)
at net.sqlcipher.database.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:903)
at net.sqlcipher.database.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:914)
at com.example.com.DBAdapter.open(DBAdapter.java:106)
at com.example.com.Spots.onCreate(Spots.java:81)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1615)
... 11 more


this is how I open database from sd card :



SQLiteDatabase.loadLibs(context);
String outFileName = Environment.getExternalStorageDirectory() +"/Android/data/"+ context.getPackageName()
+ "/files/files.dll";
File databaseFile = new File(outFileName);
db = SQLiteDatabase.openOrCreateDatabase(databaseFile,"mypass", null);


this is the image of my asset folder and lib folder :


enter image description here


Could you help me to solve this ?


thanks


0 comments:

Post a Comment