OP-Engineering / op-sqlite

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

Failed to compile in react-native-macos project #125

Closed bear-ei closed 4 months ago

bear-ei commented 4 months ago

Describe the bug CompileC /Users/bearei/Library/Developer/Xcode/DerivedData/Bearei-cfkefzitawvsoiahawyfiooznfcf/Build/Intermediates.noindex/Pods.build/Debug/op-sqlite.build/Objects-normal/x86_64/OPSQLite.o /Users/bearei/Documents/code/bear/client/Bearei/node_modules/@op-engineering/op-sqlite/ios/OPSQLite.mm normal x86_64 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'op-sqlite' from project 'Pods')

Versions:

Reproducible example npx react-native-macos-init Initialises a new react-native-macos project. Failed at compile time.

ospfranco commented 4 months ago

Without an error cannot tell what's wrong. If you can create a reproducible example I can take a more detailed look.

bear-ei commented 4 months ago

https://github.com/bear-ei/op-sqlite-react-native-macos-example

This is a pristine React Native for macOS project. After installing dependencies and Pods, the issue can be reproduced by running npx react-native run-macos.

ospfranco commented 4 months ago

The app ran just fine for me <img src="https://github.com/user-attachments/assets/30bfc53f-4fd8-49c7-941f-4ff51b61086d" width="300"/>

Did:

bear-ei commented 4 months ago

I have captured an error message through XCODE. Cannot initialize a variable of type 'BOOL' (aka 'signed char') with an rvalue of type 'id _Nullable'.

If possible, could you tell me what issues this might be related to? Many thanks.

error

ospfranco commented 4 months ago

Hard to say, chatGPT has the following suggestions:

  1. Check Xcode Version

Ensure that both machines are using the same version of Xcode. Differences in the compiler or SDK versions might cause discrepancies.

•   Open Xcode and go to Xcode > About Xcode to check the version.
  1. Check Project Settings

Verify that the project settings are identical on both machines.

•   Compare Build Settings, Build Phases, and Build Rules.
•   Ensure the same deployment target and architectures are selected.
  1. Clean the Build

Try cleaning the build folder and rebuilding the project.

•   In Xcode, go to Product > Clean Build Folder or press Shift + Command + K.
  1. Check for Third-Party Libraries

Ensure that any third-party libraries or frameworks are correctly installed and configured.

•   Verify that the necessary pods or dependencies are installed and up to date.
•   If using CocoaPods, run pod install to ensure consistency.
  1. Check Compiler and Language Settings

Ensure the compiler and language settings are consistent.

•   In Build Settings, check Objective-C Language Dialect and C Language Dialect.
•   Verify that Nullability settings are the same.
  1. Compare Environment Variables

Check for any environment variables or path differences.

•   Compare the output of env or printenv in the terminal on both machines.
•   Ensure the PATH variable includes the correct paths for Xcode tools.
  1. Verify Xcode Command Line Tools

Ensure the correct version of Xcode Command Line Tools is installed.

•   Run xcode-select --install to install or update the Command Line Tools.
  1. Check for Derived Data Issues

Sometimes, derived data can cause issues. Try deleting it.

•   In Xcode, go to Window > Organizer > Projects, select your project, and delete the derived data.