ios - 在 pod install post_install 步骤中出现重复的 UUID 警告

标签 ios xcode cocoapods

在我的 podfile 中运行以下内容时

post_install do |installer|
  installer.pods_project.targets.each do |target|
    if target.name == "React"
      target.remove_from_project
    end
  end
end

我收到这些警告:
[!] [Xcodeproj] Generated duplicate UUIDs:

XCBuildConfiguration --
XCBuildConfiguration --
PBXBuildFile --
PBXBuildFile --

这是什么原因造成的?我注意到我的计划中有一些剩余的 tvOS 目标 - 这是可能的原因吗?

最佳答案

它是由不同目录中的重复文件引起的。
有时,当您将文件移动到另一个目录时,Xcode 可能会出错并复制文件。

我的 解决方案 找到这些重复的文件,

  • 将错误消息复制到名为 duplicateUUIDs.txt 的文本文件中
  • 获取排序后的文件名并输出重复项

  • grep -E '[a-zA-Z+]+\.(h|m|swift)' -o duplicateUUIDs.txt | sort | uniq -d
    
  • 在 pod 源目录中找到它们并删除不需要的文件。

  • 另一种方法 查找重复文件

    find . -path ./.git -prune -o -type f -exec basename {} + | sort | uniq -d
    

    哪里-path ./.git -prune -o表示排除 .git查找时的目录

    https://github.com/CocoaPods/CocoaPods/issues/4370#issuecomment-602368518

    关于ios - 在 pod install post_install 步骤中出现重复的 UUID 警告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50032037/

    相关文章:

    objective-c - iphone sdk - Itunes 连接如何更改设备要求?

    ios - 找不到 'Firebase' (IOS Swift) 的规范

    iphone - 我的 Default.png 使用什么样的图像?我正在使用 iPhone 5's native resolution WITH the status bar, but it won' t 工作

    ios - 从后台远程推送通知手动递增时,应用程序的角标(Badge)编号卡在 1

    ios - 如何在 Swift 4 中应用程序处于运行状态时显示推送通知?

    c++ - 使用 Xcode 11 和 macOS Catalina (zsh) 编译后 SFML 崩溃

    iphone - 修改iOS中隐藏式字幕的字体、文本颜色

    xcode - Swift 编译器挂起!这是一个错误吗?

    swift - 使用 Xcode 9 在 iOS 11 上发布 Google map API

    ios - xcodebuild : error: 'APP.xcworkspace' does not exist