Pod install,依赖`*****`没有在任何具体目标中使用

Pod install, The dependency `*****` is not used in any concrete target

在项目上执行 pod install 时,我得到以下输出:

Analyzing dependencies
[!] The dependency `MMDrawerController (~> 0.5.7)` is not used in any concrete target.
The dependency `ViewUtils` is not used in any concrete target.
The dependency `CPAnimationSequence` is not used in any concrete target.
The dependency `iCarousel` is not used in any concrete target.
The dependency `BlocksKit (~> 2.2.5)` is not used in any concrete target.
The dependency `AFNetworking` is not used in any concrete target.
The dependency `MBProgressHUD (~> 0.8)` is not used in any concrete target.
The dependency `NSString-UrlEncode` is not used in any concrete target.
The dependency `INTULocationManager` is not used in any concrete target.
The dependency `SDWebImage (= 3.7.2)` is not used in any concrete target.
The dependency `Adjust (from `https://github.com/adjust/ios_sdk.git`, tag `v3.4.0`)` is not used in any concrete target.
The dependency `TARTT (from `https://github.com/takondi/tartt-sdk-ios.git`)` is not used in any concrete target.
The dependency `SIAlertView (~> 1.3)` is not used in any concrete target.
The dependency `GoogleAppIndexing` is not used in any concrete target.
The dependency `Gimbal` is not used in any concrete target.

如何解决此问题以便安装正常进行?

有 20 多个目标和一个 post_install 模式是否会导致问题?

我的 CocoaPod 版本是 1.1.1.

这是 Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '7.0'

pod 'MMDrawerController', '~> 0.5.7'
pod 'ViewUtils'
pod 'CPAnimationSequence'
pod 'iCarousel'
pod 'BlocksKit', '~> 2.2.5'
pod 'AFNetworking'
pod 'MBProgressHUD', '~> 0.8'
pod 'NSString-UrlEncode'
pod 'INTULocationManager'
pod 'SDWebImage', '3.7.2'
pod 'Adjust', :git => 'https://github.com/adjust/ios_sdk.git', :tag => 'v3.4.0'
pod 'TARTT', :git => 'https://github.com/takondi/tartt-sdk-ios.git'
pod 'SIAlertView', '~> 1.3'
pod 'GoogleAppIndexing'
pod 'Gimbal'

post_install do |installer_representation|
    installer_representation.project.targets.each do |target|
        target.build_configurations.each do |config|
            config.build_settings['ONLY_ACTIVE_ARCH'] = 'NO'
        end
    end
end

您的 Podfile 应该包含您要在哪个目标中安装 cocoapods 的信息。 Podfile 中的 post 安装程序仅在每个目标中将 ACTIVE_ARCH 标志设置为 NO

如果您的应用程序中有超过 20 个目标(并且当前 Podfile 中有些混乱),可以尝试删除 PodfilePodfile.lock,然后再执行 pod init。它将使 CococaPods gem 为您的应用创建一个有效的 Podfile。然后粘贴您的应用程序使用的 CocoaPods,并将 post 安装程序指令粘贴到新的 Podfile 并尝试使用 pod install.

重新安装 cocoapods

记得将 pod 指令放在正确的目标之间。

查看有关 Podfile 的 CocoaPods site

因此您的 Podfile 应该如下所示:

target 'YourTargetName' do

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '7.0'

pod 'MMDrawerController', '~> 0.5.7'
pod 'ViewUtils'
pod 'CPAnimationSequence'
pod 'iCarousel'
pod 'BlocksKit', '~> 2.2.5'
pod 'AFNetworking'
pod 'MBProgressHUD', '~> 0.8'
pod 'NSString-UrlEncode'
pod 'INTULocationManager'
pod 'SDWebImage', '3.7.2'
pod 'Adjust', :git => 'https://github.com/adjust/ios_sdk.git', :tag => 'v3.4.0'
pod 'TARTT', :git => 'https://github.com/takondi/tartt-sdk-ios.git'
pod 'SIAlertView', '~> 1.3'
pod 'GoogleAppIndexing'
pod 'Gimbal'

post_install do |installer_representation|
  installer_representation.project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['ONLY_ACTIVE_ARCH'] = 'NO'
    end
  end
end
end

有点奇怪,但 Gimbal SDK 包含 iCarousel,所以它可能与您的 podfile 有问题。

Source

只需在下面的块中添加您的 pod 文件

target 'YourApp' do
  pod '*******', '~> 1.0'
end