ios CocoaPods 无法自动选择 Xcode 项目。像这样在你的 Podfile 中指定一个
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/41162645/
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
ios CocoaPods Could not automatically select an Xcode project. Specify one in your Podfile like so
提问by hkaraoglu
I try to run pod install
command in my project directory. But it throws an error like below:
我尝试pod install
在我的项目目录中运行命令。但它会引发如下错误:
[!] Could not automatically select an Xcode project. Specify one in your Podfile like so:
project 'path/to/Project.xcodeproj'
My project directory:
我的项目目录:
- MyApp
- MyApp.xcodeproj
- MyApp.xcworkspace
- Podfile
- Podfile.lock
- Pods
podFile
pod文件
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
use_frameworks!
project '/Users/dev4/Developer/iOS/MyApp/MyApp.xcodeproj'
target 'MyApp' do
pod 'Gifu'
pod 'Alamofire'
pod 'SwiftyJSON'
pod 'Fabric'
pod 'Crashlytics'
pod 'IQKeyboardManagerSwift'
pod 'NVActivityIndicatorView'
pod 'M13Checkbox'
pod 'Kingfisher'
pod 'KMPlaceholderTextView'
pod 'WDImagePicker', :git => 'https://github.com/justwudi/WDImagePicker', :tag => 'master'
pod 'RSBarcodes_Swift', '~> 0.1.9'
pod 'CCMPopup'
pod 'Cosmos', '~> 1.0'
pod 'FLAnimatedImage', '~> 1.0'
pod 'Google/Analytics'
pod 'Reveal-iOS-SDK', :configurations => ['Debug']
end
I added code part "project 'myprojectpath/to/Project.xcodeproj'". But it didn't work. How can I solve this?
我添加了代码部分“ project 'myprojectpath/to/Project.xcodeproj'”。但它没有用。我该如何解决这个问题?
回答by Chris Livdahl
The path that you specify should be relative to your Podfile. So, if your Podfile is in "/Users/dev4/Developer/iOS/", then you should use:
您指定的路径应该相对于您的 Podfile。因此,如果您的 Podfile 位于“/Users/dev4/Developer/iOS/”中,那么您应该使用:
project 'MyApp/MyApp.xcodeproj'
回答by manisha sharma
I had copied my previous project with changing the App package name.When i came through this issue i go through my project structure and get to know that i have two .xcodeproj file .After deleting the old one i get rid of this issue.
我已经通过更改应用程序包名称复制了我以前的项目。当我遇到这个问题时,我查看了我的项目结构,并知道我有两个 .xcodeproj 文件。删除旧文件后,我摆脱了这个问题。