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

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/40234810/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 10:38:49  来源:igfitidea点击:

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

ioscocoapodscocoapods-1.1.1

提问by Chao

i have a project from another, when i pod install, the console tell me:

我有另一个项目,当我安装 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.

what is the problem? because the project has more then 20 traget, they use post_install pattern and works fine, but it don't work for me.

问题是什么?因为该项目有超过 20 个 traget,所以他们使用 post_install 模式并且工作正常,但它对我不起作用。

my cocoapod version is 1.1.1, pls help.

我的 cocoapod 版本是 1.1.1,请帮忙。

here is the Podfile:

这是 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

回答by kamwysoc

Your Podfileshould contains information in which target you want to install the cocoapods. The post installer in your Podfile sets only ACTIVE_ARCHflag to NOin each target.

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

If you have more than 20 targets in your app(and some mess in current Podfile), maybe try to remove Podfileand Podfile.lockand then do pod init. It will make CococaPods gem create a valid Podfilefor your app. Then paste the CocoaPods that your app using and paste the post installer instruction to the new Podfile and try to reinstall cocoapods using pod install.

如果你在你的应用程序(在当前Podfile一些乱七八糟的)超过20个目标,也许尝试删除PodfilePodfile.lock,然后做pod init。它将使 CococaPods gemPodfile为您的应用程序创建一个有效的。然后粘贴您的应用程序使用的 CocoaPods 并将安装后说明粘贴到新的 Podfile 中,然后尝试使用pod install.

Remember to place pod instructions between correct target.

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

Look at the CocoaPods siteabout Podfile.

查看有关 Podfile的CocoaPods 站点

So your Podfile should look like:

所以你的 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

回答by Darshit Shah

Simply add your pod file in below block

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

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

回答by kevinl

It's a little weird, but the Gimbal SDK contains iCarousel so it might have problems with your podfile.

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

Source

来源