praeclarum / sqlite-net

Simple, powerful, cross-platform SQLite client and ORM for .NET
MIT License
4k stars 1.42k forks source link

Debug local iphone result in file is not a database #1240

Open whann0205 opened 1 month ago

whann0205 commented 1 month ago

The following packages are in use: PackageReference Include="sqlite-net-sqlcipher" Version="1.9.172" /> PackageReference Include="SQLitePCLRaw.bundle_e_sqlcipher" Version="2.1.8" /> PackageReference Include="SQLitePCLRaw.provider.dynamic_cdecl" Version="2.1.8" /> It is a net maui application targetting .net8. Everything is kept up to date. Problem is that the app cannot access the database. The file get installs by using openfile OpenAppPackageFileAsync somewhere in the initialization section of the app. It is proven that the file is indeed here and accessible, have even copied the file via SMB to my File Server to check if it get installed correctly. The file is a sqllite4 format with encryption. It is working perfectly on android device, android emulator, ios emulator no matter which emulated device. it works on the mac itself, too. Not tried to deploy as a release yet. But when i try to debug the app on the iphone via hot restart (visual studio 2022 17.10.3) the file is there but i throws the exception "File is not a database". I really dont know where to start since i dont know if the problem is inside your ericsinks lib or your library or where ? I am stuck do whatever it takes to solve that problem.

sjlombardo commented 1 month ago

Disable Hot Restart, see https://github.com/ericsink/SQLitePCL.raw/issues/601