react-native-sqlite-storage icon indicating copy to clipboard operation
react-native-sqlite-storage copied to clipboard

Patch and update the android native libraries for API 30

Open rubenmaas opened this issue 3 years ago • 12 comments

Our team previously added these libraries to react-native-sqlite-storage. Now we've patched and updated the libs for Android API 30. We've tested it with JSON queries as well.

Fix for this issue: https://github.com/andpor/react-native-sqlite-storage/issues/462

rubenmaas avatar Nov 03 '21 11:11 rubenmaas

Where can we find the source code that was used to build these binaries?

MarkCSmith avatar Nov 04 '21 18:11 MarkCSmith

The sqlite library and connector code is from here (The existing binaries are also build from here) - https://github.com/liteglue/Android-sqlite-connector and https://github.com/brodybits/Android-sqlite-ext-native-driver

The Android 11 patches are from these Cordova libraries - https://github.com/OutSystems/Android-sqlite-connector/pull/1 and https://github.com/OutSystems/Android-sqlite-native-driver/pull/1

andismith avatar Nov 11 '21 12:11 andismith

Would you please include the actual upstream revision reference, as it seems impossible to determine which sqlite3 version is actually bundled? Or better yet, enable us to build the same version from source code by submoduling the revision you include. They way you document this, we have to take at face value that an undocumented bundled binary is safe with no way of verifying where it in fact came from.

osmaa avatar Nov 19 '21 06:11 osmaa

Sure. You can checkout the actual sqlite (and included plugin) upstream submodule revisions from here - https://github.com/brodybits/Android-sqlite-ext-native-driver. All of these are build from sources with no binaries involved.

The core sqlite submodule is here - https://github.com/liteglue/sqlite-amalgamation/tree/8266a49e2d49deb42422f9b48f49fe94c73971e2, where you can verify the sqlite source from the origin (https://www.sqlite.org/2020/sqlite-amalgamation-3320300.zip). You can similarly verify the sources for the other submodules.

Also, the build instructions are provided in the connector and driver repos. You can easily rebuild the binaries for verification by following those steps. The only modifications made are the two Android 11 patches from the listed PR, which you can manually apply.

andismith avatar Nov 19 '21 10:11 andismith

You may need to add to your proguard-rules.pro

-keep class io.liteglue.** { *; }

tszajna0 avatar Nov 22 '21 18:11 tszajna0

I will merge this in this upcoming week. I am getting new hardware and it is taking a while to ship. Can you confirm that the libraries are backward compatible, json1 support included and povide instructions how to build them. Many thanks.

andpor avatar Jan 08 '22 19:01 andpor

I will merge this in this upcoming week. I am getting new hardware and it is taking a while to ship. Can you confirm that the libraries are backward compatible, json1 support included and povide instructions how to build them. Many thanks.

can you tell us when do you want to merge this PR?

FatemeMirzaeii avatar Jan 18 '22 14:01 FatemeMirzaeii

App crashes in run time

@castalonirenz, have you try adding the proguard rule mentioned by @tszajna0 https://github.com/andpor/react-native-sqlite-storage/pull/494#issuecomment-975822945

will-tsang avatar Jul 12 '22 10:07 will-tsang

I will merge this in this upcoming week. I am getting new hardware and it is taking a while to ship. Can you confirm that the libraries are backward compatible, json1 support included and povide instructions how to build them. Many thanks.

Hi @andpor. Any news on this?

creekorful avatar Sep 29 '22 16:09 creekorful

I'm trying to use the this PR to solve the Android 11 issue but I'm getting the below error message when testing. If anyone else has run into this error and has a solution I would appreciate any advise. Thanks. I'm testing on a Pixel 1 with Android 10 with ReactNative 0.63

2022-10-03 11:01:01.927 26878-26937/? runtime.cc:638] JNI DETECTED ERROR IN APPLICATION: mid == null
2022-10-03 11:01:02.072 26943-26943/? A/DEBUG: Abort message: 'JNI DETECTED ERROR IN APPLICATION: mid == null
        in call to NewObject
        from io.liteglue.SQLiteResponse io.liteglue.SQLiteNative.sqlc_db_open(java.lang.String, int)

bwmarrin avatar Oct 03 '22 18:10 bwmarrin

any solution to this issue ? if i removed the dependencies then it not worked in other android versions.

usmanmalik333 avatar Jan 30 '23 07:01 usmanmalik333

Thank you very much for your current normal operation

hengkx avatar Aug 21 '23 04:08 hengkx