guardianproject/android-database-sqlcipher — Issue #34: What about Android 4.0 support?
Author: Vitaly-Olshevsky
Created: 2011-12-07 10:54:06+00:00
State: open

It seems that the latest release (0.0.6-FINAL) doesn't work properly on Android 4.0 (at least on emulator).

I've tested the library on notepadbot application, as well as on this sample activity:

```
public class HelloSQLCipherActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
InitializeSQLCipher();
}

private void InitializeSQLCipher() {
SQLiteDatabase.loadLibs(this);
File databaseFile = getDatabasePath("demo.db");
databaseFile.mkdirs();
databaseFile.delete();
SQLiteDatabase database = SQLiteDatabase.openOrCreateDatabase(databaseFile, "test123", null);
database.execSQL("create table t1(a, b)");
database.execSQL("insert into t1(a, b) values(?, ?)", new Object[]{"one for the money",
"two for the show"});
}
}
```

And i'm always getting the next exception during the database creation:

```
12-07 13:02:44.364: E/AndroidRuntime(682): Caused by: info.guardianproject.database.sqlcipher.SQLiteException: not an error
12-07 13:02:44.364: E/AndroidRuntime(682):	at info.guardianproject.database.sqlcipher.SQLiteDatabase.dbopen(Native Method)
12-07 13:02:44.364: E/AndroidRuntime(682):	at info.guardianproject.database.sqlcipher.SQLiteDatabase.(SQLiteDatabase.java:1870)
12-07 13:02:44.364: E/AndroidRuntime(682):	at info.guardianproject.database.sqlcipher.SQLiteDatabase.openDatabase(SQLiteDatabase.java:863)
12-07 13:02:44.364: E/AndroidRuntime(682):	at info.guardianproject.database.sqlcipher.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:897)
12-07 13:02:44.364: E/AndroidRuntime(682):	at info.guardianproject.database.sqlcipher.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:890)
12-07 13:02:44.364: E/AndroidRuntime(682):	at com.sqlcipher.test.SQLCipherTestActivity.initializeSQLCipher(SQLCipherTestActivity.java:23)
12-07 13:02:44.364: E/AndroidRuntime(682):	at com.sqlcipher.test.SQLCipherTestActivity.onCreate(SQLCipherTestActivity.java:15)
12-07 13:02:44.364: E/AndroidRuntime(682):	at android.app.Activity.performCreate(Activity.java:4465)
12-07 13:02:44.364: E/AndroidRuntime(682):	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
12-07 13:02:44.364: E/AndroidRuntime(682):	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1919)
12-07 13:02:44.364: E/AndroidRuntime(682):	... 11 more
```

On all version below 3.2 everything works fine.

Does SQLCipher for android currently supports version 4.0? Have it been tested yet? Is there some workaround?
(Or maybe i'm just doing something wrong?)