net.sqlcipher.database.SQLiteException: not an error:
Asked Answered
S

2

6

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

Stator answered 25/3, 2013 at 10:10 Comment(1)
does this issue solved ?Ammonal
S
-1

I got my solution :-

i just add

else if(type == XmlPullParser.TEXT) {
    Log.d(Tag, "Have text = "+xpp.getText());
    if(xpp.isWhitespace())
    {

    }
    else
    {
    String strquery = xpp.getText();
    db.execSQL(strquery);
    }

}

I am checking if white space after ENDTAG then do nothing and go to next.

Stator answered 27/3, 2013 at 4:54 Comment(0)
T
5

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

Thibodeau answered 25/3, 2013 at 13:14 Comment(0)
S
-1

I got my solution :-

i just add

else if(type == XmlPullParser.TEXT) {
    Log.d(Tag, "Have text = "+xpp.getText());
    if(xpp.isWhitespace())
    {

    }
    else
    {
    String strquery = xpp.getText();
    db.execSQL(strquery);
    }

}

I am checking if white space after ENDTAG then do nothing and go to next.

Stator answered 27/3, 2013 at 4:54 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.