我尝试在项目目录中运行pod install
命令。但它会抛出如下错误:
[!] Could not automatically select an Xcode project. Specify one in your Podfile like so:
project 'path/to/Project.xcodeproj'
我的项目目录:
- MyApp
- MyApp.xcodeproj
- MyApp.xcworkspace
- Podfile
- Podfile.lock
- Pods
podFile
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
我添加了代码部分“项目'myprojectpath / to / Project.xcodeproj'”。但它没有用。我该如何解决这个问题?
答案 0 :(得分:1)
您指定的路径应该与您的Podfile相关。因此,如果您的Podfile位于" / Users / dev4 / Developer / iOS /",那么您应该使用:
project 'MyApp/MyApp.xcodeproj'
答案 1 :(得分:0)
我复制了我之前的项目,更改了App包名称。当我遇到这个问题时,我通过我的项目结构,并了解我有两个.xcodeproj文件。删除旧的后,我摆脱了这个问题。