簡體   English   中英

xcode 構建失敗 隱式轉換丟失 integer 精度:“size_t”(又名“unsigned long”)到“socklen_t”(又名“unsigned int”)

[英]xcode build failing over Implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'socklen_t' (aka 'unsigned int')

這是我第一次在這里發帖,我也是 mac、xcode(12) 和 react native 的新手。 即使是空的反應原生項目,我也無法使構建成功。 我試圖在模擬器版本之間切換並不斷收到不同的錯誤,但總是使用 Flipper-Folly。 這發生在模擬器版本 14.3 中,在文件 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);

作為新手前端開發人員,我真的不知道我在看什么,任何幫助將不勝感激!

我能夠擺脫這個問題的唯一方法是在 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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM