[HD2 Android Q&A, Help & Troubleshooting and Genera] gmeurant:
Hi,

I often install new roms on NAND, and always backup the one in use beforing installing a new one.

Often too, I restore the backup of my previous rom and everything works perfect.

But... this time, I did that and almost all applications are crashing on execution.

Using ADB logcat, I see that the process cannot open certain database files. For example, with cputuner:

I/Database( 1357): sqlite returned: error code = 14, msg = cannot open file at line 27206 of [42537b6056]
E/Database( 1357): sqlite3_open_v2("/data/data/ch.amana.android.cputuner/databases/cputuner", &handle, 6, NULL) failed
E/SQLiteOpenHelper( 1357): Couldn't open cputuner for writing (will try read-only):
E/SQLiteOpenHelper( 1357): android.database.sqlite.SQLiteException: unable to open database file
E/SQLiteOpenHelper( 1357): at android.database.sqlite.SQLiteDatabase.dbopen(Native Method)
E/SQLiteOpenHelper( 1357): at android.database.sqlite.SQLiteDatabase.<init>(SQLiteDatabase.java:1923)
E/SQLiteOpenHelper( 1357): at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:906)
E/SQLiteOpenHelper( 1357): at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:940)
E/SQLiteOpenHelper( 1357): at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:933)
E/SQLiteOpenHelper( 1357): at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:589)
E/SQLiteOpenHelper( 1357): at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:203)
E/SQLiteOpenHelper( 1357): at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:98)
E/SQLiteOpenHelper( 1357): at android.database.sqlite.SQLiteOpenHelper.getReadableDatabase(SQLiteOpenHelper.java:158)
E/SQLiteOpenHelper( 1357): at ch.amana.android.cputuner.provider.db.DBBackendCpuProfile.query(DBBackendCpuProfile.java:87)
E/SQLiteOpenHelper( 1357): at ch.amana.android.cputuner.provider.CpuTunerProvider.query(CpuTunerProvider.java:97)
E/SQLiteOpenHelper( 1357): at android.content.ContentProvider$Transport.query(ContentProvider.java:169)
E/SQLiteOpenHelper( 1357): at android.content.ContentResolver.query(ContentResolver.java:245)
E/SQLiteOpenHelper( 1357): at ch.amana.android.cputuner.helper.InstallHelper.updateDefaultProfiles(InstallHelper.java:64)
E/SQLiteOpenHelper( 1357): at ch.amana.android.cputuner.helper.InstallHelper.populateDb(InstallHelper.java:273)
E/SQLiteOpenHelper( 1357): at ch.amana.android.cputuner.application.CpuTunerApplication.onCreate(CpuTunerApplication.java:18)
E/SQLiteOpenHelper( 1357): at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:978)
E/SQLiteOpenHelper( 1357): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4630)
E/SQLiteOpenHelper( 1357): at android.app.ActivityThread.access$3000(ActivityThread.java:136)
E/SQLiteOpenHelper( 1357): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2223)
E/SQLiteOpenHelper( 1357): at android.os.Handler.dispatchMessage(Handler.java:99)
E/SQLiteOpenHelper( 1357): at android.os.Looper.loop(Looper.java:143)
E/SQLiteOpenHelper( 1357): at android.app.ActivityThread.main(ActivityThread.java:5068)
E/SQLiteOpenHelper( 1357): at java.lang.reflect.Method.invokeNative(Native Method)
E/SQLiteOpenHelper( 1357): at java.lang.reflect.Method.invoke(Method.java:521)
E/SQLiteOpenHelper( 1357): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
E/SQLiteOpenHelper( 1357): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
E/SQLiteOpenHelper( 1357): at dalvik.system.NativeStart.main(Native Method)

Does it means the app cannot get write access to the database file ?

How should I correct this for all files ?

Thanks.

Gerald.