可可足类 1.0:"xcodeproj was renamed to `project`. Please use that from now on."

Cocoapods 1.0: "xcodeproj was renamed to `project`. Please use that from now on."

当 运行 pod install 使用 Cocoapods 1.0.

时,我确实收到警告 xcodeproj was renamed toproject. Please use that from now on.

此外,[NSBundle bundleWithIdentifier:@"org.cocoapods.xyz"] returns nil

对于版本 0.39.0,我没有收到警告并且 [NSBundle bundleWithIdentifier:@"org.cocoapods.xyz"] returns 一个有效的包。

有人知道解决这个问题的方法吗?

查看您的 Podfile。你有像

这样的字符串

xcodeproj 'MyProj/MyProj.xcodeproj'

只需将 xcodeproj 替换为 project

project 'MyProj/MyProj.xcodeproj'

Release Notes 1.0.0.beta.3 (2016-02-03). GitHub issue

Rename the xcodeproj Podfile directive to project.

只需将 xcodeproj 替换为 project

  1. 刚刚偶然发现了这个问题。将 xcodeproj 重命名为 project 后,警告仍然存在。我意识到字符串 xcodeproj 路径不是需要重命名为 project 的路径,而是 Cocoapod xcodeproj.
  2. 的 param/key

如果您想明确指出目标项目文件,就会发生这种情况。就我而言,我必须明确指出它,因为我的目标是拥有一个针对两个不同项目的 Podfile。


所以从这个:

source 'https://github.com/CocoaPods/Specs'

platform :ios, '13.0'

def commonpods
  pod 'Mixpanel'
end

workspace 'MixpanelSample'
xcodeproj 'MixpanelSample_Swift/MixpanelSample_Swift.xcodeproj'
xcodeproj 'MixpanelSample_Objc/MixpanelSample_Objc.xcodeproj'

target 'MixpanelSample_Swift' do
    xcodeproj 'MixpanelSample_Swift/MixpanelSample_Swift.xcodeproj'
    commonpods
end

target 'MixpanelSample_Objc' do
    xcodeproj 'MixpanelSample_Objc/MixpanelSample_Objc.xcodeproj'
    commonpods
end

对此:

source 'https://github.com/CocoaPods/Specs'

platform :ios, '13.0'

def commonpods
  pod 'Mixpanel'
end

workspace 'MixpanelSample'
project 'MixpanelSample_Swift/MixpanelSample_Swift.xcodeproj'
project 'MixpanelSample_Objc/MixpanelSample_Objc.xcodeproj'

target 'MixpanelSample_Swift' do
    project 'MixpanelSample_Swift/MixpanelSample_Swift.xcodeproj'
    commonpods
end

target 'MixpanelSample_Objc' do
    project 'MixpanelSample_Objc/MixpanelSample_Objc.xcodeproj'
    commonpods
end