square / react-native-square-reader-sdk

React Native Plugin for Square Reader SDK
Apache License 2.0
115 stars 34 forks source link

[iOS] '@import' error in AppDelegate.mm file #192

Closed gm-esoft closed 1 year ago

gm-esoft commented 2 years ago

Parse Issue Group /Users/UserName/Library/Developer/Xcode/DerivedData/tabbardrawerdemo-ckocjvrmrkkkhhdojmincqfubugt/Build/Products/Debug-iphonesimulator/SquareReaderSDK.framework/Headers/SQRDReaderSDK.h:17:1: Use of '@import' when C++ modules are disabled, consider using -fmodules and -fcxx-modules /Users/UserName/Code/Research/EPOS/tabbardrawerdemo/ios/tabbardrawerdemo/AppDelegate.mm:9:9: in file included from /Users/UserName/Code/Research/EPOS/tabbardrawerdemo/ios/tabbardrawerdemo/AppDelegate.mm:9: I also tried with #import <SquareReaderSDK/SQRDReaderSDK.h> and #import "SquareReaderSDK/SQRDReaderSDK.h" but not worked.

System: OS: macOS 12.5.1 CPU: (4) x64 Intel(R) Core(TM) i5-4278U CPU @ 2.60GHz Memory: 32.80 MB / 8.00 GB Shell: 5.8.1 - /bin/zsh Binaries: Node: 16.15.1 - ~/.nvm/versions/node/v16.15.1/bin/node Yarn: 1.22.17 - /usr/local/bin/yarn npm: 8.5.5 - ~/.nvm/versions/node/v16.15.1/bin/npm Watchman: 2022.07.04.00 - /usr/local/bin/watchman Managers: CocoaPods: 1.11.3 - /usr/local/bin/pod SDKs: iOS SDK: Platforms: DriverKit 21.4, iOS 15.5, macOS 12.3, tvOS 15.4, watchOS 8.5 Android SDK: API Levels: 27, 28, 29, 30, 31, 32 Build Tools: 28.0.3, 29.0.2, 30.0.2, 31.0.0, 33.0.0 Android NDK: Not Found IDEs: Android Studio: 2021.2 AI-212.5712.43.2112.8609683 Xcode: 13.4.1/13F100 - /usr/bin/xcodebuild Languages: Java: 11.0.15 - /Library/Java/JavaVirtualMachines/jdk-11.0.15.jdk/Contents/Home/bin/javac npmPackages: @react-native-community/cli: Not Found react: 17.0.2 => 17.0.2 react-native: 0.68.2 => 0.68.2 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found

mormrod commented 2 years ago

Hi, I came across your issue whilst trying to fix a different one. Please see the comment I left on my own issue once I had solved it. Hope it helps:

UPDATE: I've got it working on RN 0.69.5, but there are some steps:

With all those things in place, it did eventually build for RN 0.69.5.

The docs are in dire need of an update, as is the troubleshooting guide which is now 4 years old and not even remotely accurate

CharmisG commented 1 year ago

Hello @gm-esoft @mormrod

Thank you for the update, but if you still face issues, please take a pull from the latest code update.