Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expo SDK49 upgrade errors #12

Open
derekstavis opened this issue Jul 30, 2023 · 10 comments
Open

Expo SDK49 upgrade errors #12

derekstavis opened this issue Jul 30, 2023 · 10 comments
Labels
bug Something isn't working

Comments

@derekstavis
Copy link

derekstavis commented Jul 30, 2023

After upgrading to SDK49 I started getting the following error when using expo run:ios:

❌  (ios/Pods/Headers/Public/react-native-quick-sqlite/sqlite3.h:723:8)

  721 | */
  722 | typedef struct sqlite3_file sqlite3_file;
> 723 | struct sqlite3_file {
      |        ^ redefinition of 'sqlite3_file'
  724 |   const struct sqlite3_io_methods *pMethods;  /* Methods for an open file */
  725 | };
  726 | 

This is an excerpt of the full error, as this block repeats for the various SQLite structs. Reverting to SDK48 solves the problem.

@Jokerwolf
Copy link

Having the same error without expo.

@Montchy Montchy added the bug Something isn't working label Aug 14, 2023
@derekstavis
Copy link
Author

derekstavis commented Aug 15, 2023

expo-sqlite now uses JSI and so I believe this package can be replaced by that. For who wants to migrate, expo-sqlite creates the database files in documentDirectory + "SQLite", so you'll need to do some file moving.

Update: I tried replacing by expo-sqlite but it has inconsistent SQLite versions on Android and iOS, so I reverted to quick-sqlite and SDK48. Also, created this issue expo/expo#23970

@peterferguson
Copy link

I was experiencing this. Seems it was a conflict with the headers of the native sqlite version on IOS

You should be able to solve it using this part of the docs

I just added the env var to my eas.json

  {
    "production":  {
            "distribution": "store",
            "env": {
                "STAGE": "production",
                "FLIPPER_DISABLE": "1",
                "QUICK_SQLITE_USE_PHONE_VERSION": "1"
            },
            "channel": "production"
        }
  }

@derekstavis
Copy link
Author

You should be able to solve it using this part of the docs

Beware that while this is a feasible solution for some use cases, it will result in inconsistent SQLite versions across iOS and Android. It's the same problem that I had with with expo-sqlite.

@nmalzieu
Copy link

I'm having the same kind of errors :


/app/ios/Pods/Headers/Public/react-native-quick-sqlite/sqlite3.h:723:8: error: redefinition of 'sqlite3_file'
struct sqlite3_file {
       ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.4.sdk/usr/include/sqlite3.h:736:8: note: previous definition is here
struct sqlite3_file {
       ^

@L-U-C-K-Y
Copy link
Contributor

I chime in also face this issue with Expo SDK 49 that I would need with MacOS Sonoma

@nmalzieu
Copy link

nmalzieu commented Oct 2, 2023

If I check the header files for the embedded sqlite version for iOS, I see that there is the following ifndef:

#ifndef _SQLITE3_H_

But in this lib there is the following one:

#ifndef SQLITE3_H

So I created the following patch to use with patch-package:

react-native-quick-sqlite+8.0.5.patch

And the app now builds on my side. I'm unsure if this is dangerous or not!

@derekstavis
Copy link
Author

derekstavis commented Oct 12, 2023

And the app now builds on my side. I'm unsure if this is dangerous or not!

This will solve duplicated versions of SQLite but it will also cause the OS SQLite version to be used, resulting in inconsistent SQLite versions across iOS and Android.

To be even more precise here, it will use the “first version found” which could be either the OS one or the one embedded in this package, as it depends on the order of compilation

@nmalzieu
Copy link

@derekstavis got it. I was printing SQLite version and it printed the one embedded in the lib, but I see what you mean and that could def be dangerous.
Any idea why the headers started conflicting while it was ok before though?

@ospfranco
Copy link

I think Expo started embedding their expo-sqlite library by default on their GO version. So it looks like they are importing the OS embedded version. At least that was what I saw went testing the recent versions of Expo. Nothing wrong with this library, in any case, they need to only import the library when expo-sqlite is used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants