A Unity ID allows you to buy and/or subscribe to Unity products and services, shop in the Asset Store and participate
in the Unity community.
Discussion in 'Android' started by rambramdt, Jul 17, 2011.
Thanks zenggangZg0, your libsqlite3.so fixed our problem!
It works!!! Thank you!!!
Sorry to bump up this old topic, but in Android 9.0 there seems to be an issue with libsqlite3. I'm using the SimpleSQL unity3d plugin to manage my database and there is a libsqlite3.so file added. It works fine on Android 8.1.0 and lower Android versions. But as soon as I open the app on an Android 9.0 device (Same installation e.t.c.) I get the following error:
SQLiteException: database disk image is malformed
at SimpleSQL.SQLite3.Prepare2 (IntPtr db, System.String query) [0x00000] in <filename unknown>:0
at SimpleSQL.SQLiteCommand.Prepare () [0x00000] in <filename unknown>:0
at SimpleSQL.SQLiteCommand.ExecuteQuery[User] (SimpleSQL.TableMapping map) [0x00000] in <filename unknown>:0
at SimpleSQL.SQLiteCommand.ExecuteQuery[User] () [0x00000] in <filename unknown>:0
at SimpleSQL.TableQuery`1[User].GetEnumerator () [0x00000] in <filename unknown>:0
at System.Linq.Enumerable+<CreateSelectIterator>c__Iterator10`2[User,User].MoveNext () [0x00000] in <filename unknown>:0
at System.Linq.Enumerable.First[User] (IEnumerable`1 source) [0x00000] in <filename unknown>:0
at User.getUser (SimpleSQL.SimpleSQLManager dbManager) [0x00000] in <filename unknown>:0
at Translation.getLocalizationForKey (SimpleSQL.SimpleSQLManager dbManager, System.String key) [0x00000] in <filename unknown>:0
at PVMInstructionsSceneManager.setTranslations () [0x00000] in <fi
Can it have something to do with with this change in Android 9.0?:
Java UTF decoder
UTF-8 is the default charset in Android. A UTF-8 byte sequence can be decoded by a String constructor, such as String(byte bytes).
The UTF-8 decoder in Android 9 follows the Unicode standards more strictly than in previous versions. The changes include the following:
The non-shortest form of UTF-8, such as <C0, AF>, is treated as ill-formed.
The surrogate form of UTF-8, such as U+D800..U+DFFF, is treated as ill-formed.
The maximal subpart is replaced by a single U+FFFD. For example, in the byte sequence "41 C0 AF 41 F4 80 80 41," the maximal subparts are "C0," "AF," and "F4 80 80." "F4 80 80" can be the initial subsequence of "F4 80 80 80", but "C0" can't be the initial subsequence of any well-formed code unit sequence. Thus, the output should be "A\ufffd\ufffdA\ufffdA."
To decode a modified UTF-8 / CESU-8 sequence in Android 9 or higher, use the DataInputStream.readUTF()method or the NewStringUTF() JNI method.
I have a question,please help me if you had the answer: i have a question :How use Sqlite on Android? I read the sqlite from StreamingAssets on the start and File.WriteAllBytes to persistentDataPath ,and then link the db. but i got the error:the database disk image is malformed ... please help me