netpyoung / SqlCipher4Unity3D

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

Android Multi thread Error #21

Closed JinhyukLc closed 3 years ago

JinhyukLc commented 5 years ago

I ran quite heavy tasks on another thread like this.

void SomeMethod()
{
    m_Thread = new System.Threading.Thread(Run);
    m_Thread.Start();
}

void Run()
{
    // Heavy Tasks like CreateTable, InsertTable
}

This code works well in editor, iOS builds and latest android builds, but in below environments, everything stops or sometimes crashes without any throwing exceptions or debug messages,

When I changed my code with single-threaded version, no bugs occured.

Also everything worked well before I updated this plugin. (My project used this since 2017 and I never updated until now).

Thanks.

netpyoung commented 5 years ago

That's interesting.

JinhyukLc commented 5 years ago

Thanks for fast reply!

I tried with some other versions(3.4, 3.3, 3.5.7) of android-data-sqlcipher and not worked. 😢

netpyoung commented 5 years ago

Maybe It caused by IL2CPP..... or v3's problem...

JinhyukLc commented 5 years ago

I set target architectures to both ARMv7 and ARM64. I tried both on Android 9.0 (Galaxy S9+) by adb install --abi arm64-v8a xxxx.apk and adb install --abi armeabi-v7a xxxx.apk and everything worked, But not on an Android 6.0 device(Galaxy note 4, which supports only ARMv7)..

Note that I made only one more thread other than unity's main thread and every db operations run on that thread one by one.

netpyoung commented 3 years ago

This issue is outdated. and I'm not sure Is this issue still exists on current Sqlcipher version. So I close this issue at this moment.