moneymanagerex / android-money-manager-ex

Manage your finances on-the-go, encrypted for security, and sync via your storage
http://android.moneymanagerex.org/
GNU General Public License v3.0
508 stars 188 forks source link

Error while open DB android.database.sqlite.SQLiteException [GPlay] #1922

Open wolfsolver opened 5 days ago

wolfsolver commented 5 days ago

Describe the bug From gPlay

need to managed by try catch and give error instead of dump.

Versione: 1048 (2024.11.22) 2 user affected:

Exception android.database.sqlite.SQLiteException: file is not a database: , while compiling: select count(*) from sqlite_master;
  at net.sqlcipher.database.SQLiteCompiledSql.native_compile
  at net.sqlcipher.database.SQLiteCompiledSql.compile (SQLiteCompiledSql.java:89)
  at net.sqlcipher.database.SQLiteCompiledSql.<init> (SQLiteCompiledSql.java:62)
  at net.sqlcipher.database.SQLiteProgram.<init> (SQLiteProgram.java:91)
  at net.sqlcipher.database.SQLiteQuery.<init> (SQLiteQuery.java:50)
  at net.sqlcipher.database.SQLiteDirectCursorDriver.query (SQLiteDirectCursorDriver.java:60)
  at net.sqlcipher.database.SQLiteDatabase.rawQueryWithFactory (SQLiteDatabase.java:2019)
  at net.sqlcipher.database.SQLiteDatabase.rawQuery (SQLiteDatabase.java:1905)
  at net.sqlcipher.database.SQLiteDatabase.keyDatabase (SQLiteDatabase.java:2672)
  at net.sqlcipher.database.SQLiteDatabase.openDatabaseInternal (SQLiteDatabase.java:2602)
  at net.sqlcipher.database.SQLiteDatabase.openDatabase (SQLiteDatabase.java:1250)
  at net.sqlcipher.database.SQLiteDatabase.openOrCreateDatabase (SQLiteDatabase.java:1325)
  at net.sqlcipher.database.SQLiteOpenHelper.getWritableDatabase (SQLiteOpenHelper.java:167)
  at net.sqlcipher.database.SupportHelper.getWritableDatabase (SupportHelper.java:83)
  at net.sqlcipher.database.SupportHelper.getReadableDatabase (SupportHelper.java:111)
  at com.money.manager.ex.database.MmxOpenHelper.getDatabase (MmxOpenHelper.java:137)
  at com.money.manager.ex.database.MmxOpenHelper.getReadableDatabase (MmxOpenHelper.java:142)
  at com.money.manager.ex.settings.DatabaseSettingsFragment.refreshDbVersion (DatabaseSettingsFragment.java:132)
  at com.money.manager.ex.settings.DatabaseSettingsFragment.onCreate (DatabaseSettingsFragment.java:73)
  at androidx.fragment.app.Fragment.performCreate (Fragment.java:3090)
  at androidx.fragment.app.FragmentStateManager.create (FragmentStateManager.java:475)
  at androidx.fragment.app.FragmentStateManager.moveToExpectedState (FragmentStateManager.java:257)
  at androidx.fragment.app.FragmentManager.executeOpsTogether (FragmentManager.java:1901)
  at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute (FragmentManager.java:1819)
  at androidx.fragment.app.FragmentManager.execPendingActions (FragmentManager.java:1762)
  at androidx.fragment.app.FragmentManager.dispatchStateChange (FragmentManager.java:2987)
  at androidx.fragment.app.FragmentManager.dispatchActivityCreated (FragmentManager.java:2897)
  at androidx.fragment.app.FragmentController.dispatchActivityCreated (FragmentController.java:263)
  at androidx.fragment.app.FragmentActivity.onStart (FragmentActivity.java:351)
  at androidx.appcompat.app.AppCompatActivity.onStart (AppCompatActivity.java:251)
  at com.money.manager.ex.common.MmxBaseFragmentActivity.onStart (MmxBaseFragmentActivity.java:132)
  at android.app.Instrumentation.callActivityOnStart (Instrumentation.java:1544)
  at android.app.Activity.performStart (Activity.java:8511)
  at android.app.ActivityThread.handleStartActivity (ActivityThread.java:3667)
  at android.app.servertransaction.TransactionExecutor.performLifecycleSequence (TransactionExecutor.java:224)
  at android.app.servertransaction.TransactionExecutor.cycleToPath (TransactionExecutor.java:204)
  at android.app.servertransaction.TransactionExecutor.executeLifecycleState (TransactionExecutor.java:176)
  at android.app.servertransaction.TransactionExecutor.execute (TransactionExecutor.java:97)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2304)
  at android.os.Handler.dispatchMessage (Handler.java:106)
  at android.os.Looper.loopOnce (Looper.java:201)
  at android.os.Looper.loop (Looper.java:288)
  at android.app.ActivityThread.main (ActivityThread.java:7930)
  at java.lang.reflect.Method.invoke
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:548)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:942)
wolfsolver commented 3 days ago

Probabile related to issue when try to create a dB with a name that already exist on filesystem