netpyoung / SqlCipher4Unity3D

💾 SqlCipher made easy for Unity3d
MIT License
163 stars 37 forks source link

SQLiteException: file is not a database #32

Open tunnel opened 3 years ago

tunnel commented 3 years ago

I used an older version of your plugin. Tried to upgrade to a newer version and an error occurs when trying to open the database. And when running 1.1.x and when running v1.0.x:

SQLiteException: file is not a database SqlCipher4Unity3D.SQLite3.Prepare2 (System.IntPtr db, System.String query) (at Assets/SqlCipher4Unity3D/Sqlite3.cs:278) SqlCipher4Unity3D.SQLiteCommand.Prepare () (at Assets/SqlCipher4Unity3D/Sqlite3Connection.cs:1853) SqlCipher4Unity3D.SQLiteCommand+<ExecuteDeferredQuery>d__131[T].MoveNext () (at Assets/SqlCipher4Unity3D/Sqlite3Connection.cs:1758) System.Collections.Generic.List1[T]..ctor (System.Collections.Generic.IEnumerable1[T] collection) (at <567df3e0919241ba98db88bec4c6696f>:0) System.Linq.Enumerable.ToList[TSource] (System.Collections.Generic.IEnumerable1[T] source) (at <351e49e2a5bf4fd6beabb458ce2255f3>:0) SqlCipher4Unity3D.SQLiteCommand.ExecuteQuery[T] () (at Assets/SqlCipher4Unity3D/Sqlite3Connection.cs:1730) SqlCipher4Unity3D.TableQuery1[T].GetEnumerator () (at Assets/SqlCipher4Unity3D/Sqlite3Connection.cs:2125) System.Collections.Generic.List1[T]..ctor (System.Collections.Generic.IEnumerable1[T] collection) (at <567df3e0919241ba98db88bec4c6696f>:0) System.Linq.Enumerable.ToList[TSource] (System.Collections.Generic.IEnumerable1[T] source) (at <351e49e2a5bf4fd6beabb458ce2255f3>:0) SqlCipher4Unity3D.TableQuery1[T].FirstOrDefault () (at Assets/SqlCipher4Unity3D/Sqlite3Connection.cs:2564)

I think this is because my database is an older version (although its version is 3 and in theory v1.0.x should work, but it does not work) I found a topic about this error, is it possible to update my database automatically in the same way?

MinhLuongNeo commented 3 years ago

It looks like I got this error, your database file has a password or not, and what type of password did you use. This lib only supports SQLCipher3 default.

Ảnh chụp Màn hình 2020-11-09 lúc 14 34 09