OP-Engineering / op-sqlite

Fastest SQLite library for react-native by @ospfranco
MIT License
593 stars 41 forks source link

Build error when react native is build from source #150

Closed pigeonmal closed 2 months ago

pigeonmal commented 2 months ago

Describe the bug I modified react native, so I must build from source. (React native is modified with patch, so inside node_modules folder). When I try to build app with opsqlite as dependency i got multiple errors, this is the first : C/C++: ld.lld: error: undefined symbol: facebook::jsi::HostObject::~HostObject() C/C++: >>> referenced by SmartHostObject.h:13. It's like jsi is not definded ? The errors are not from my patches, because I try with 0 modification, only build from source, and got the same errors.

Versions:

Link Reproducible example Just add this inside your settings.gradle :

includeBuild('../node_modules/react-native') {
    dependencySubstitution {
        substitute(module("com.facebook.react:react-android")).using(project(":packages:react-native:ReactAndroid"))
        substitute(module("com.facebook.react:react-native")).using(project(":packages:react-native:ReactAndroid"))
        substitute(module("com.facebook.react:hermes-android")).using(project(":packages:react-native:ReactAndroid:hermes-engine"))
        substitute(module("com.facebook.react:hermes-engine")).using(project(":packages:react-native:ReactAndroid:hermes-engine"))
    }
}

And build

ospfranco commented 2 months ago

This goes beyond the scope and time of what I do to maintain the library, so you are better off asking on StackOverflow.

pigeonmal commented 2 months ago

Hi, I know you don't have much time, and you work hard to maintain this library. But I'm really stuck since 1 week. I just need to modify one file: CMakeLists.txt .

I tried to ask for help on react native, but they send me here. https://github.com/facebook/react-native/issues/46593#issuecomment-2367679623

If you can help me, and fix this bug, I will be really grateful.

ospfranco commented 2 months ago

you can modify node_modules/@op-engineering/op-sqlite/android/CMakeLists.txt yourself and try to figure out what the problem is, but the module is not doing anything special and I'm not an expert in the build system of RN itself, so no idea what could be wrong.