You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sqlite-vec successfully compiles and run on Android (from what I tried on Termux on an old phone).
But how can we package and distribute sqlite-vec to make it easier for Android developers to use?
I don't know much about Android development or packages, so any help and insight would be greatly appreciated. I specifically have the following questions, so please answer in this thread if you know of an answer!
What Android SQLite client libraries are popular, and do they support dynamically loading SQLite extensions?
What "package managers" exist for 3rd party Android libraries?
How do Android libraries typically bundle pre-compiled shared object files?
P.S. - if you're company or organization would benefit from sqlite-vec on Android, I'd love to have you as a sponsor!
Reacted by David Miguel Lozano, binggo512, Miguel Daipré, ksiom, bonzaiferroni, John Knox, Wesley and foloinfo
Said function is unfortunately not exposed to the JS side of the library as of writing, but can be worked around.
For whatever reason, .so files in react-native seem to cause issues if not following the convention of lib<name>.so stemming from some mechanism in the SoLoader library used to load source files. I found that if proguard rules stripped the SoLoader errors, it will lead to a crash.
I would recommend the android source files be named libsqlitevec.so or something of that nature.
Hey, I'm the author of op-sqlite. I want to integrate sqlite-vec into my library. The best way you can help RN, Android (and IOS) devs is by adding a make file rule that compiles an .so for android and a .a for iOS with a rule in the makefile.
For Android you need to be able to compile to 4 archs:
At least on Rust those are the name of the archs, no idea on how to compile C to those specific archs. Once the files are generated it's a matter of packaging them to be consumed on iOS (via an xcframework) and Android (via an AAR or just a file structure).
If you can provide some compilation instructions I can then integrate it into my library (and also expo-sqlite would follow the same steps)
What Android SQLite client libraries are popular, and do they support dynamically loading SQLite extensions?
Room is a official ORM from Google. sqlite-bundled support dynamically loading SQLite extensions, and it also provided by Google.
sqlite-bundled provided BundledSQLiteDriver class, it's addExtension function support dynamically loading SQLite extensions
val driver =BundledSQLiteDriver()
driver.addExtension("vec0.so", "sqlite3_vec_init")
Room.databaseBuilder(context, klass =MyDatabase::class.java, name ="my-db").setDriver(driver).build()
Binaries for Android are already released. You can download them from the releases page. You can them pack them however you want to be loaded into your Android app. There are many resources online on how to do that.
Activity
Vali-98 commentedon Aug 23, 2024
On the react-native side,
expo-sqliteis capable of loading .so files as sqlite3 plugins with a bit of patching, as demonstrated in this patch file I made for my react-native app: https://github.com/Vali-98/ChatterUI/blob/master/patches/expo-sqlite%2B14.0.5.patchSaid function is unfortunately not exposed to the JS side of the library as of writing, but can be worked around.
For whatever reason,
.sofiles in react-native seem to cause issues if not following the convention oflib<name>.sostemming from some mechanism in theSoLoaderlibrary used to load source files. I found that if proguard rules stripped theSoLoadererrors, it will lead to a crash.I would recommend the android source files be named
libsqlitevec.soor something of that nature.waqasakram117 commentedon Aug 25, 2024
ospfranco commentedon Aug 26, 2024
Hey, I'm the author of op-sqlite. I want to integrate sqlite-vec into my library. The best way you can help RN, Android (and IOS) devs is by adding a make file rule that compiles an
.sofor android and a.afor iOS with a rule in the makefile.For Android you need to be able to compile to 4 archs:
At least on Rust those are the name of the archs, no idea on how to compile C to those specific archs. Once the files are generated it's a matter of packaging them to be consumed on iOS (via an xcframework) and Android (via an AAR or just a file structure).
If you can provide some compilation instructions I can then integrate it into my library (and also expo-sqlite would follow the same steps)
zivids commentedon Dec 25, 2025
Room is a official ORM from Google.
sqlite-bundled support dynamically loading SQLite extensions, and it also provided by Google.
sqlite-bundled provided BundledSQLiteDriver class, it's addExtension function support dynamically loading SQLite extensions
ospfranco commentedon Dec 25, 2025
Binaries for Android are already released. You can download them from the releases page. You can them pack them however you want to be loaded into your Android app. There are many resources online on how to do that.