Xcode/Cocoapods项目在添加TVOS目标和更改Podfile结构后搞砸了

Urk*_*man 1 ios cocoapods crashlytics swift xcode7

我正在研究更大的项目(Swift)和一些Pods,到目前为止一切都很好......现在我想添加一个tvos目标,现在我的项目搞砸了:(

还有一种简单的方法可以重现:

1.)创建一个新的SingleView应用程序,并在Xcode中将其命名为"pod-test"

2.)打开它吧

3.)运行pod init以创建Podfile

4.)使用以下命令编辑Podfile:use_frameworks!平台:ios,'8.0'

pod 'Alamofire'
pod 'ObjectMapper'
pod 'AlamofireObjectMapper'

pod 'Fabric'
pod 'Crashlytics'

pod 'Nuke'
pod 'MGSwipeTableCell'
pod 'GradientCircularProgress', :git => 'https://github.com/keygx/GradientCircularProgress'

pod 'Reveal-iOS-SDK', :configurations => ['Debug']
Run Code Online (Sandbox Code Playgroud)

5.)运行pod安装

6.)打开工作区项目文件运行应用程序

7.)现在添加两个目标并将其命名为"pod-test-tvos"

8.)运行iOS和tvos应用程序.一切都还好

9.)使用以下命令编辑Podfile:

source 'https://github.com/CocoaPods/Specs.git'


target 'pod-test' do
    use_frameworks!
    platform :ios, '8.0'

    pod 'Alamofire'
    pod 'ObjectMapper'
    pod 'AlamofireObjectMapper'

    pod 'Fabric'
    pod 'Crashlytics'

    pod 'Nuke'
    pod 'MGSwipeTableCell'
    pod 'GradientCircularProgress', :git => 'https://github.com/keygx/GradientCircularProgress'

    pod 'Reveal-iOS-SDK', :configurations => ['Debug']
end

target 'pod-test-tvos' do
    use_frameworks!
    platform :tvos, '9.0'

    pod 'Fabric'
    pod 'Crashlytics'

end
Run Code Online (Sandbox Code Playgroud)

10.)将pod-test和pod-test-tvos的配置编辑为none

10.)关闭XCode

11.)再次运行pod安装

12.)再次打开Xcode

13.)再次运行iOS和TVOS应用......仍然一切都很好

14.)为两个目标编辑"AppDelegate"并仅添加此导入:

import Fabric
Run Code Online (Sandbox Code Playgroud)

15.)再次运行iOS和TVOS应用程序......并且繁荣... iOS运行良好TVOS说没有找到Fabric :(

这一切都发生了,因为我在添加TVOS目标后"更改"了Podfile ...

只需这一步就可以了:

1.)创建一个新的SingleView应用程序,并在Xcode中将其命名为"pod-test"

2.)现在添加两个目标,并将其命名为"pod-test-tkos"

3.)运行pod init以创建Podfile

4.)使用以下命令编辑Podfile:

source 'https://github.com/CocoaPods/Specs.git'


target 'pod-test' do
    use_frameworks!
    platform :ios, '8.0'

    pod 'Alamofire'
    pod 'ObjectMapper'
    pod 'AlamofireObjectMapper'

    pod 'Fabric'
    pod 'Crashlytics'

    pod 'Nuke'
    pod 'MGSwipeTableCell'
    pod 'GradientCircularProgress', :git => 'https://github.com/keygx/GradientCircularProgress'

    pod 'Reveal-iOS-SDK', :configurations => ['Debug']
end

target 'pod-test-tvos' do
    use_frameworks!
    platform :tvos, '9.0'

    pod 'Fabric'
    pod 'Crashlytics'

end
Run Code Online (Sandbox Code Playgroud)

5.)运行pod安装

6.)打开工作区项目文件运行应用程序

7.)为两个目标编辑"AppDelegate"并仅添加此导入:

import Fabric
Run Code Online (Sandbox Code Playgroud)

8.)再次运行iOS和TVOS应用......仍然一切都很好

因此,在"旧"项目中更改Podfile似乎存在问题...

我希望有人可以帮我解决这个问题:)

Isa*_*ker 5

这可以通过使用deintegrateCocoapods 1.0中的命令来解决.

  1. 关闭Xcode
  2. 打开终端并导航到包含Podfile的目录.
  3. pod deintegrate
  4. pod install
  5. 在Xcode中打开您的工作区并构建.