React Native,iOS 构建因 React-native-maps 失败 [已解决]

问题描述 投票:0回答:1

我希望这里有人可以帮助我解决我的问题。

我正在使用react-native v 0.73.2

在 Android 上,应用程序成功构建,但我在构建 iOS 版本时遇到问题。 Cocopods 已经成功安装,但是当运行“yarn ios”时,我遇到了这个错误:

The following build commands failed:
    CompileC /Users/nino/Library/Developer/Xcode/DerivedData/PlitviceMobile-aonymzxbkvahywhidgtjlsmxrplx/Build/Intermediates.noindex/PlitviceMobile.build/Debug-iphonesimulator/PlitviceMobile.build/Objects-normal/arm64/AIRGoogleMapOverlayManager.o /Users/nino/code/plitvice/node_modules/react-native-maps/ios/AirGoogleMaps/AIRGoogleMapOverlayManager.m normal arm64 objective-c com.apple.compilers.llvm.clang.1_0.compiler (in target 'PlitviceMobile' from project 'PlitviceMobile')
(1 failure)

当从 xcode 运行它时,我遇到了一堆错误。

任何人都知道可能是什么问题以及我该如何解决这个问题?

我已经尝试运行我在网上找到的所有内容,包括:

  • 重新安装react-native-maps
  • 重新安装 Pod
  • 清理了构建文件夹
  • 从 xcode 运行构建
ios react-native google-maps
1个回答
0
投票

对于任何偶然发现这个特定问题的人,我希望这会有所帮助。 我已经设法为我的案例解决了这个问题。 我正在从版本升级<0.60 to latest 0.73 version and the application had some registered sources in the Target >编译源。

其中大部分与 AIRGoogleManager 等 React-native-maps 的 google 依赖关系有关。

我已将它们全部删除,只留下 main.m 和 AppDelegate.mm,之后我就可以构建项目了。

在此之前的步骤是:

  • 将 HAVE_GOOGLE_MAPS=1 添加到项目设置 > 构建设置 > 预处理器宏
  • 将其添加到“构建设置”>“标头搜索路径”->“${SRCROOT}/../node_modules/react-native-maps/ios/AirMaps”,并使其从非递归开始递归
  • 升级的cocoapod安装程序
  • 升级xcodeproj
  • 在构建设置中,我排除了不需要的架构。
  • 在项目 - >构建设置 - >无公共块:是
  • 我设置的所有 iOS 版本都反映了我的 podfile (13.4) 中的版本
  • 我通过在 podfile 中注释此行来禁用 Flipper 套件:
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable the next line.
#    :flipper_configuration => flipper_config,

我希望这对某人有帮助。

© www.soinside.com 2019 - 2024. All rights reserved.