我刚刚决定创建几个具有不同配置的不同方案。但是,当我尝试构建它时,它得到“没有这样的模块'podname'”。
我已遵循this指南,并尝试在添加配置文件的步骤之前进行构建。为什么我的豆荚无法识别?我创建的新方案名为“开发”,“测试”和“生产”。
这是我的Podfile的样子:
当我运行Pod安装时,会收到以下消息:
[!] Automatically assigning platform `ios` with version `10.0` on target `NoteIt` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.
[!] CocoaPods did not set the base configuration of your project because your project already has a custom config set. In order for CocoaPods integration to work at all, please either set the base configurations of the target `NoteIt` to `Pods/Target Support Files/Pods-NoteIt/Pods-NoteIt.debug (development).xcconfig` or include the `Pods/Target Support Files/Pods-NoteIt/Pods-NoteIt.debug (development).xcconfig` in your build configuration (`NoteIt/Development.xcconfig`).
[!] CocoaPods did not set the base configuration of your project because your project already has a custom config set. In order for CocoaPods integration to work at all, please either set the base configurations of the target `NoteIt` to `Pods/Target Support Files/Pods-NoteIt/Pods-NoteIt.debug (test).xcconfig` or include the `Pods/Target Support Files/Pods-NoteIt/Pods-NoteIt.debug (test).xcconfig` in your build configuration (`NoteIt/Test.xcconfig`).
[!] CocoaPods did not set the base configuration of your project because your project already has a custom config set. In order for CocoaPods integration to work at all, please either set the base configurations of the target `NoteIt` to `Pods/Target Support Files/Pods-NoteIt/Pods-NoteIt.debug (production).xcconfig` or include the `Pods/Target Support Files/Pods-NoteIt/Pods-NoteIt.debug (production).xcconfig` in your build configuration (`NoteIt/Production.xcconfig`).
[!] CocoaPods did not set the base configuration of your project because your project already has a custom config set. In order for CocoaPods integration to work at all, please either set the base configurations of the target `NoteIt` to `Pods/Target Support Files/Pods-NoteIt/Pods-NoteIt.release(development).xcconfig` or include the `Pods/Target Support Files/Pods-NoteIt/Pods-NoteIt.release(development).xcconfig` in your build configuration (`NoteIt/Development.xcconfig`).
[!] CocoaPods did not set the base configuration of your project because your project already has a custom config set. In order for CocoaPods integration to work at all, please either set the base configurations of the target `NoteIt` to `Pods/Target Support Files/Pods-NoteIt/Pods-NoteIt.release(test).xcconfig` or include the `Pods/Target Support Files/Pods-NoteIt/Pods-NoteIt.release(test).xcconfig` in your build configuration (`NoteIt/Test.xcconfig`).
[!] CocoaPods did not set the base configuration of your project because your project already has a custom config set. In order for CocoaPods integration to work at all, please either set the base configurations of the target `NoteIt` to `Pods/Target Support Files/Pods-NoteIt/Pods-NoteIt.release(production).xcconfig` or include the `Pods/Target Support Files/Pods-NoteIt/Pods-NoteIt.release(production).xcconfig` in your build configuration (`NoteIt/Production.xcconfig`).
[!] The `NoteIt [Debug (Development)]` target overrides the `ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES` build setting defined in `Pods/Target Support Files/Pods-NoteIt/Pods-NoteIt.debug (development).xcconfig'. This can lead to problems with the CocoaPods installation
- Use the `$(inherited)` flag, or
- Remove the build settings from the target.
[!] The `NoteIt [Debug (Test)]` target overrides the `ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES` build setting defined in `Pods/Target Support Files/Pods-NoteIt/Pods-NoteIt.debug (test).xcconfig'. This can lead to problems with the CocoaPods installation
- Use the `$(inherited)` flag, or
- Remove the build settings from the target.
[!] The `NoteIt [Debug (Production)]` target overrides the `ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES` build setting defined in `Pods/Target Support Files/Pods-NoteIt/Pods-NoteIt.debug (production).xcconfig'. This can lead to problems with the CocoaPods installation
- Use the `$(inherited)` flag, or
- Remove the build settings from the target.
[!] The `NoteIt [Release(Development)]` target overrides the `ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES` build setting defined in `Pods/Target Support Files/Pods-NoteIt/Pods-NoteIt.release(development).xcconfig'. This can lead to problems with the CocoaPods installation
- Use the `$(inherited)` flag, or
- Remove the build settings from the target.
[!] The `NoteIt [Release(Test)]` target overrides the `ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES` build setting defined in `Pods/Target Support Files/Pods-NoteIt/Pods-NoteIt.release(test).xcconfig'. This can lead to problems with the CocoaPods installation
- Use the `$(inherited)` flag, or
- Remove the build settings from the target.
[!] The `NoteIt [Release(Production)]` target overrides the `ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES` build setting defined in `Pods/Target Support Files/Pods-NoteIt/Pods-NoteIt.release(production).xcconfig'. This can lead to problems with the CocoaPods installation
- Use the `$(inherited)` flag, or
- Remove the build settings from the target.
在清理后构建时出现以下错误:
我的配置设置如下:
答案 0 :(得分:5)
删除.xcworkspace
,Podfile.lock
和Pods/
目录。完成后
pod install
现在,打开新生成的.xcworkspace
文件,并在您自己的.xcconfig
文件中添加Cocoapods的.xcconfig
路径。
有关解决此问题的更多详细信息,请参阅link。 这样可以解决问题。
快乐编码:)
答案 1 :(得分:0)
我复制了您的问题,并收到相同的错误“沙盒与Podfile.lock不同步”
即使在.xcworkspace之后,Pod文件夹和Pod相关的阶段也发生了相同的错误,因此仔细检查该错误,我发现它没有找到Pods .xcconfig文件。但是,在Pods文件夹的路径Pods/Target Support Files/Pods-NoteIt
上,我看到这些文件确实存在:
> Pods-NoteIt.debug (beta) Pods-NoteIt.debug (development).xcconfig
> Pods-NoteIt.debug (production) Pods-NoteIt.debug (qa)
> Pods-NoteIt.debug (uat) Pods-NoteIt.debug
>
> Pods-NoteIt.release (beta) Pods-NoteIt.release (development)
> Pods-NoteIt.release (production) Pods-NoteIt.release (qa)
> Pods-NoteIt.release (uat) Pods-NoteIt.release
>
> Pods-NoteIt.debug (beta).xcconfig Pods-NoteIt.debug
> (development).xcconfig Pods-NoteIt.debug (production).xcconfig
> Pods-NoteIt.debug (qa).xcconfig Pods-NoteIt.debug (uat).xcconfig
> Pods-NoteIt.debug.xcconfig
>
> Pods-NoteIt.release (beta).xcconfig Pods-NoteIt.release
> (development).xcconfig Pods-NoteIt.release (production).xcconfig
> Pods-NoteIt.release (qa).xcconfig Pods-NoteIt.release (uat).xcconfig
> Pods-NoteIt.release.xcconfig
我所做的是在我手动创建的每个.xcconfig
上都包含必需的文件。因此,例如,在Development.xcconfig
上我添加了以下内容:
#include "Pods/Target Support Files/Pods-NoteIt/Pods-NoteIt.debug (uat).xcconfig"
#include "Pods/Target Support Files/Pods-NoteIt/Pods-NoteIt.release (uat).xcconfig"
因此,如果您添加了一些其他变量(如本教程中的变量),则文件看起来像这样:
对每个.xcconfig
(开发,生产,质量检查,测试版,UAT)重复此操作之后,我就能够成功构建并运行该项目。
答案 2 :(得分:0)
我有同样的问题。我通过删除项目中的所有pod文件和派生数据文件夹来解决此问题。从我的机器上卸载所有Pod。然后我重新安装了它们。
sudo gem卸载cocoapods
sudo gem install cocoapods
pod初始化
pod安装
答案 3 :(得分:0)
在另一篇有关podfile.lock同步的文章中,解决方案是:
pod deintegrate --verbose
pod install --verbose
如果这不起作用,只需遵循错误代码并重新安装coca-pods 链接到问题The sandbox is not in sync with the Podfile.lock-ios
答案 4 :(得分:-1)
在pod文件中,为每个架构添加目标 尝试这样的事情:
def shared_pods
pod 'SideMenuSwift'
pod 'Alamofire'
pod 'ObjectMapper'
pod 'SwiftDate'
pod 'NVActivityIndicatorView'
pod 'SwiftyUserDefaults'
end
target 'Target1' do
shared_pods
end
target 'Target2' do
shared_pods
end