Build error on Maccatalyst
See original GitHub issueCurrent behavior
I’m trying to make my react-native app work with MacOS (Maccatalyst). Everything works fine (after some fixes on react-native modules which I can provide if necessary) except for React-Native Async-Storage.
When I try to build my project for MacOS, I get the following error
ld: library not found for -lRNCAsyncStorage
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Indeed, the library does not appear in the build folder (~/Library/Developer/Xcode/DerivedData/myapp/Build/Products/Debug-maccatalyst
)
However, no error arise on the build of the library itself (the only error I see is the one above and it appears under the main project)
I’m not totally sure if this comes from this lib or if it comes from react-native, but all my other native libraries work fine.
Thank you all for your help.
Expected behavior
It should build fine.
Repro steps
- Fix react-native to work with MacCatalyst Since this is too big to put inside the issue, I published an article for how to fix react-native 0.59 to work with MacCatalyst. https://github.com/giregk/react-native-0.59-fix-maccatalyst
- Attempt building the project after linking @react-native-community/async-storage
What I have tried so far
I have tried to apply the following changes to the RNCAsyncStorage Project:
- Project -> info -> iOS deployment target 9.0
- Project -> build settings -> deployment -> macOS deployment Target = macOS 10.15
- Project -> build settings -> Mac Catalyst deployment -> Derive Mac Catalyst Product Bundle Identifier = NO
- Project -> build settings -> Mac Catalyst deployment -> Supports Mac Catalyst = YES
I have also tried to let XCode fix the warning about the the recommended settings
Of course, before each build attempt, I have applied “Product Menu > clean build folder”
////////// Edit I also tried to copy paste the module in my project manually and it works. So it is not a problem in the code, but rather a problem in the project config //////////
Environment
- Async Storage version: 1.7.1
- React-Native version: 0.59.10
- Platform tested: iOS (Maccatalyst also known as UIKitForMac)
- Logs/Error that are relevant: NA
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (4 by maintainers)
Top GitHub Comments
@tido64 OK, very clear. That’s weird though because all my dependencies are npm modules, linked with the
react-native link
command, and that command does not add the library to the list of dependencies, which you seem to believe is mandatory. Thanks again for your help and for the explanation.@Krizzu thank you for sending @tido64 to my rescue !!