OP-Engineering/op-sqlite

Unable to use op-sqlite with react-native-firebase

Closed this issue · 3 comments

Describe the bug
When I use op-sqlite with react-native-firebase, it throws an error when I run expo run:ios. The error is a repetition of something like this:

› Compiling @op-engineering/op-sqlite Pods/op-sqlite » bindings.cpp

❌  (node_modules/@op-engineering/op-sqlite/cpp/sqlite3.h:729:8)

  727 | */
  728 | typedef struct sqlite3_file sqlite3_file;
> 729 | struct sqlite3_file {
      |        ^ redefinition of 'sqlite3_file'
  730 |   const struct sqlite3_io_methods *pMethods; /* Methods for an open file */
  731 | };
  732 | 

In my research, I found this issue GetStream/stream-chat-react-native#2123 that maybe related to this one.
As suggested in this issue, I tried to run OP_SQLITE_USE_PHONE_VERSION=1 npx pod-install, but it does not solve the error.

Versions:

  • OS and version: iOS 17
  • op-sqlite version: 3.0.7
  • RN version: 0.73.6
  • Expo version: 50.0.14
  • New Architecture: Yes and no (both does not work)

Reproducible example

https://github.com/arthur-fontaine/repro-op-sqlite-firebase-incompatible

Steps:

  • npm i
  • npx expo prebuild --clean
  • npm run ios

use_frameworks breaks everything unfortunately. You can give this a try in your podfile:

  pre_install do |installer|
    installer.pod_targets.each do |pod|
      if pod.name.eql?('op-sqlite')
        def pod.build_type
          Pod::BuildType.static_library
        end
      end
    end
  end

I thought I added it to the docs but I will check again.

Yeah I did

https://ospfranco.notion.site/Installation-93044890aa3d4d14b6c525ba4ba8686f

RTFM please :)

I didn't see it, it was late, I'm sorry. Thank you!