Skip to content

Latest commit

 

History

History
58 lines (42 loc) · 3.02 KB

how_to_reproduce.md

File metadata and controls

58 lines (42 loc) · 3.02 KB

How to reproduce

Requirements:

  • JDK (minimum 1.7)
  • Android NDK (Set ANDROID_NDK_HOME and add NDK to the path)

SQLite

Under the sqlite folder, we have all we need to build SQLite with all extensions we need, almost all subfolder are submodules:

Note: In order to update the SQLite version, we just need to update the sqlite-amalgamation submodule.

Android

Under platforms/android we have all we need to build the SQLite module for android.
You should note we have two subfolder:

  • android-sqlite-native-driver: Make the link between SQLite, all extension and JNI
  • android-sqlite-connector: The bridge between JNI and Java to use SQLite on Android

Theses two folder come from two different repo but are not submodule because they have been tweeked to fix the Android 11 bug.
Under src/main/... there is the bridge from Java to Javascript in order to use the library with React Native.

Android 11 fix

Following the issue and the PR:

We create two folder in platforms/android:

We respectively patch both projects with these PR from another project:

Build the driver

In order to making thing work with Android, we first need to build the connector & driver, run:

make -C platforms/android

This will build both project and move libs & connector under platforms/android-native/libs, you need to have the android NDK in your path.
DON'T FORGET TO RUN THIS COMMAND BEFORE DEPLOYING ON NPM.

iOS

Under platforms/ios, the code is close to the one in the original repository (/~https://github.com/andpor/react-native-sqlite-storage/blob/master/platforms/ios/SQLite.m), but we made few changes:

  • Remove thing related to regex (as it's now bundled with our SQLite)
  • Remove the sqlite library reference in the react-native-sqlite-storage.podspec (as it's now bundled with our SQLite too)
  • Add #include "../../sqlite/sqlite-amalgamation/sqlite3.h" (and few other stuff) in the SQlite.m file, in order to effectively use our SQLite version