question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Build error on Maccatalyst

See original GitHub issue

Current 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

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:closed
  • Created 4 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
giregkcommented, Feb 4, 2020

@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.

1reaction
giregkcommented, Feb 4, 2020

@Krizzu thank you for sending @tido64 to my rescue !!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error uploading only Mac Catalyst … | Apple Developer Forums
Every time I try to upload the Mac Catalyst build of my App to App Store Connect, I get the following error: Asset...
Read more >
Build error MT0057 for .net Maui iOS, Mac Catalyst builds with ...
I can build and run for Mac Catalyst fine with this command dotnet build -t:Run -f net6.0-maccatalyst MyApp.csproj but when I try to...
Read more >
Build error Mac Catalyst · Issue #10279 · firebase ... - GitHub
Description I am facing a linking error while building Mac Catalyst, error log: Undefined symbols for architecture x86_64: ...
Read more >
Mac Catalyst build fails with "building for Mac Catalyst-x86_64 ...
I can't find any build setting that would address this problem, and a Web search turns up no hits on this exact error....
Read more >
mac-catalyst not building - Visual Studio Feedback
When adding mac-catalyst target framework to an iOS project ... The project doesn't build and report this error ... Error MSB4019: The imported...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found