netpyoung / SqlCipher4Unity3D

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

Crash on some device when open connection in Task c# #31

Open MinhLuongNeo opened 3 years ago

MinhLuongNeo commented 3 years ago

I used this in a Task and the game crashed on some device: SQLiteConnection sqlCon = new SQLiteConnection (fullFilePath, passwordToSetup);

I see that the reason is when calling SQLite3.Open but I don't understand why because it called native from here.

This is my logcat:

logcat
MinhLuongNeo commented 3 years ago

I found the solution, just call SQLite3.Threadsafe () somewhere in the main thread before open connection.

netpyoung commented 3 years ago

It so strange error message. NoClassDefFoundError.

If possible Could you post some example of code that?

It will be helpful which have same error.

MinhLuongNeo commented 3 years ago

When I open a connection like this in a task. It will crash on some devices. The device I use is: Oppo A37fw Android version: 5.1.1 It also happens on the MemuPlay emulator with android version 5.x

Ảnh chụp Màn hình 2020-10-21 lúc 13 24 40

But if I open it like this, it should work perfectly

Ảnh chụp Màn hình 2020-10-21 lúc 13 33 04