Skip to content

Instruction to build for iOS/Android platforms #156

@AlexanderBykin

Description

@AlexanderBykin

Hi

First of all, thank you for your project.

It made it possible to search in database of my project using the "like" operator in Cyrillic symbols.

Below is my contribution to the open source project in the form of build instructions for iOS and Android platforms.

I did it for my project written with Flutter and it works stable several month in a row.

SQLean build for iOS/Android which is used in SQLite as a plug-in extension

SQLite:
https://sqlite.org/download.html

SQLean:
https://github.com/nalgeon/sqlean

Common steps to build SQLean

  • clone SQLean
  • download SQLite Amalgamation
  • copy SQLite sources into <sqlean_root>/src/
  • copy/replace <project_root>/thirdparty/sqlean/Makefile into <sqlean_root>
  • copy <project_root>/thirdparty/sqlean/sqlean.framework.template into <sqlean_root>

Build for Android

There is already compiled shared libraries that can be found at <project_root>/android/app/src/main/jniLibs

To build again

  • Android NDK 28.0.12674087 version needed
  • edit <project_root>/android/app/build.gradle find and uncomment section externalNativeBuild
  • edit <project_root>/android/app/src/main/jni/sqlean/Android.mk and change SQLEAN_PATH variable to your cloned <sqlean_root>
  • read <project_root>/android/app/src/main/jni/sqlean/README.md and patch sources
  • build APK, unzip that APK
  • find lib directory, there will be already compiled libraries
  • copy libraries into <project_root>/android/app/src/main/jniLibs
  • edit <project_root>/android/app/build.gradle find and comment section externalNativeBuild to prevent build libraries again

Build for iOS

There is already compiled dynamic libraries which is packaged into Framework regarding to Apple rules that can be found at <project_root>/ios/sqlean.xcframework

To build again

  • XCode and CommandLine tools should be installed
  • open <sqlean_root> in terminal
  • run command make compile-ios-arm64 and make compile-ios-sim-arm64 that will compile dynamic libraries
  • package into framework, run command make pack-ios-framework that will create sqlean.xcframework at <sqlean_root>/dist
  • copy <sqlean_root>/dist/sqlean.xcframework into <project_root>/ios/
  • open iOS ios/Runner.xcworkspace project, open Build Phases tab of project, create Run Script
  • add that lines below as script
# For real devices
SQLEAN_DEVICE_PATH="${PROJECT_DIR}/sqlean.xcframework/ios-arm64/sqlean.framework/sqlean"
if [ -f "${SQLEAN_DEVICE_PATH}" ]; then
    install_name_tool -id @rpath/sqlean.framework/sqlean "${SQLEAN_DEVICE_PATH}"
fi

# For simulators
SQLEAN_SIMULATOR_PATH="${PROJECT_DIR}/sqlean.xcframework/ios-arm64_x86_64-simulator/sqlean.framework/sqlean"
if [ -f "${SQLEAN_SIMULATOR_PATH}" ]; then
    install_name_tool -id @rpath/sqlean.framework/sqlean "${SQLEAN_SIMULATOR_PATH}"
fi

thirdparty.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions