0

This is my first time posting here and I'm also new to mac, xcode(12) and react native. I can't get the build to succeed in even an empty react native project. I tried to switch between simulator versions and keep getting different errors, but always with Flipper-Folly. This one occurs with simulator version 14.3, in file SocketAddress.ccp:

sockaddr_storage tmp_sock;
  storage_.addr.toSockaddrStorage(&tmp_sock, port_);
  int rc = getnameinfo(
      (sockaddr*)&tmp_sock,
      sizeof(sockaddr_storage),
      buf,
      buflen, //this is where the error is: Implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'socklen_t' (aka 'unsigned int')
      nullptr,
      0,
      flags);
  if (rc != 0) {
    auto os = sformat(
        "getnameinfo() failed in getIpString() error = {}", gai_strerror(rc));
    throw std::system_error(rc, std::generic_category(), os);

I really don't know what I'm looking at as a newbie frontend developer, any help would be much appreciated!

Dana
  • 11
  • 2
  • This sounds like a warning, not an error. Are you building with treat-warning-as-errors option? Also, what part of it confuses you? It just complains about different types (buflen being "bigger" than expected). – Dan M. Feb 16 '21 at 13:04
  • @DanM. I'm not building with treat warning as errors. The part that confuses me is all of it. As said, I'm new to this. All I know is that the build fails, and when I click on the error icon to see it, this is where it leads me. Now I took another look and only when i went over the list on the left is where i saw the actual error icon and this is what it said: /Users/Dana/Desktop/trial/ios/Pods/Headers/Private/Flipper-Folly/folly/synchronization/DistributedMutex-inl.h:1051:5: 'atomic_notify_one' is unavailable – Dana Feb 16 '21 at 13:23
  • then this is not a cause for the build failure. This is a warning. If you search 'Implicit conversion loses integer precision' you'll get countless of the examples on this very site, but on itself it's mostly harmless - just warning about implicit conversion from wider int to smaller one that might truncate the value if the bigger number doesn't fit in the smaller type (so some cautiousness is needed). You can `static_cast()` it (making the conversion explicit) to get rid of the warning (unless buflen can actually be to big, then you need to add checks). – Dan M. Feb 16 '21 at 13:30
  • I've found an question with a similar problem: https://stackoverflow.com/questions/66189325/xcode-throws-atomic-notify-oneunsigned-long-is-unavailable Could be an XCode12/react bug, like https://github.com/facebook/react-native/issues/29633 . You can try reporting the issue and asking for help there. – Dan M. Feb 16 '21 at 13:34
  • @DanM. thank you for your help. I'll check those links and hopefully find a solution. – Dana Feb 16 '21 at 17:09

1 Answers1

1

The only way I was able to get rid of the problem was to disable flipper in Podfile

# Enables Flipper.
  #
  # Note that if you have use_frameworks! enabled, Flipper will not work and
  # you should disable these next few lines.
  # use_flipper!
  # post_install do |installer|
  #   flipper_post_install(installer)
  # end
end
Dana
  • 11
  • 2