OP-Engineering / op-sqlite

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

Build error when react native is build from source #150

Closed pigeonmal closed 1 month ago

pigeonmal commented 1 month 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 1 month 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 1 month 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 1 month 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.