agrosner / DBFlow

A blazing fast, powerful, and very simple ORM android database library that writes database code for you.
MIT License
4.87k stars 598 forks source link

Fatal crash in API 35 from FileNotFoundException on init call #1741

Open shobhik opened 1 month ago

shobhik commented 1 month ago

Hi there,

DBFlow Version: 4.2.4

Bug or Feature Request: Bug for sure

Description: When pushing to API 33 on a fresh install, I get an exception on FlowManager.init() but the new DB is successfully initialized. When pushing to a VM with API 35, there is a fatal crash with an identical stacktrace.

20:01:49.166  5280-5280  FlowLog                 com.example.myapp  E  java.io.FileNotFoundException: MyDbFile.db
                                                                                            at android.content.res.AssetManager.nativeOpenAsset(Native Method)
                                                                                            at android.content.res.AssetManager.open(AssetManager.java:904)
                                                                                            at android.content.res.AssetManager.open(AssetManager.java:881)
                                                                                            at com.raizlabs.android.dbflow.structure.database.DatabaseHelperDelegate.restoreDatabase(DatabaseHelperDelegate.java:261)
                                                                                            at com.raizlabs.android.dbflow.structure.database.DatabaseHelperDelegate.performRestoreFromBackup(DatabaseHelperDelegate.java:53)
                                                                                            at com.simplebutneeded.android.commons.database.SQLCipherOpenHelper.performRestoreFromBackup(SQLCipherOpenHelper.java:73)
                                                                                            at com.raizlabs.android.dbflow.config.DatabaseDefinition.getHelper(DatabaseDefinition.java:250)
                                                                                            at com.raizlabs.android.dbflow.config.DatabaseDefinition.getWritableDatabase(DatabaseDefinition.java:257)
                                                                                            at com.raizlabs.android.dbflow.config.FlowManager.init(FlowManager.java:324)
                                                                                            at com.example.myapp.database.MyDatabaseInitializer.initializeDatabase(MyDatabaseInitializer.java:68)