Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I am getting this error in my android app db.

In SQLite database i am getting database query from my scripts in assets folder with the help of this code.

manager = context.getResources().getAssets();
            input = manager.open("createDb.xml");
            xpp.setInput(input, null);
            int type = xpp.getEventType();
            while(type != XmlPullParser.END_DOCUMENT) {
                if(type == XmlPullParser.START_DOCUMENT) {

                    Log.d(Tag, "In start document");
                }
                else if(type == XmlPullParser.START_TAG) {
                    Log.d(Tag, "In start tag = "+xpp.getName());
                }
                else if(type == XmlPullParser.END_TAG) {
                    Log.d(Tag, "In end tag = "+xpp.getName());

                }
                else if(type == XmlPullParser.TEXT) {
                    Log.d(Tag, "Have text = "+xpp.getText()); 
                    String strquery = xpp.getText();
                    db.execSQL(strquery);
                }
                type = xpp.next();
            }
        } 
        catch (XmlPullParserException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }

and its working fine.

but i am running the same code in SQLCipher database its giving this error and application crash's always.

even i have add all necessary libs .

Failure 0 (not an error) on 0x1a1ab0 when executing '
 FATAL EXCEPTION: main
 net.sqlcipher.database.SQLiteException: not an error: 
    at net.sqlcipher.database.SQLiteDatabase.native_execSQL(Native Method)
    at net.sqlcipher.database.SQLiteDatabase.execSQL(SQLiteDatabase.java:1834)
    at com.acs.android.fwk.database.ScriptExecutor.executeScripts(ScriptExecutor.java:86)
    at com.acs.android.fwk.database.DatabaseHelper.onCreate(DatabaseHelper.java:55)
    at net.sqlcipher.database.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:121)
    at com.acs.android.fwk.database.DatabaseAdapter.open(DatabaseAdapter.java:79)
    at com.acs.android.fwk.database.DatabaseAdapter.<init>(DatabaseAdapter.java:49)
    at com.acs.android.fwk.database.DatabaseAdapter.getInstance(DatabaseAdapter.java:37)
    at com.acs.nomad.ui.controller.DbDemoController.saveData(DbDemoController.java:27)
    at com.acs.nomad.ui.controller.DbDemoController_$1.onClick(DbDemoController_.java:39)
    at android.view.View.performClick(View.java:3511)
    at android.view.View$PerformClick.run(View.java:14105)
    at android.os.Handler.handleCallback(Handler.java:605)
    at android.os.Handler.dispatchMessage(Handler.java:92)
    at android.os.Looper.loop(Looper.java:137)
    at android.app.ActivityThread.main(ActivityThread.java:4424)
    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:784)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
    at dalvik.system.NativeStart.main(Native Method)

any help please.

Thansk

like image 651
Monty Avatar asked Mar 25 '13 10:03

Monty


1 Answers

Verify that you have included the icudt46l.zip file within the assets directory as this is required for SQLCipher for Android to operate.

like image 157
Nick Parker Avatar answered Nov 15 '22 01:11

Nick Parker