27

我有另一个项目,当我安装 pod 时,控制台告诉我:

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 个 traget,所以他们使用 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
4

3 回答 3

43

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

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

请记住在正确的目标之间放置 pod 指令。

查看有关 Podfile 的CocoaPods 站点

所以你的 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
于 2016-10-25T09:02:18.217 回答
34

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

target 'YourApp' do
  pod '*******', '~> 1.0'
end
于 2017-04-25T07:01:50.400 回答
0

这有点奇怪,但 Gimbal SDK 包含 iCarousel,因此您的 podfile 可能会出现问题。

来源

于 2016-12-13T16:02:32.180 回答