2016-03-08 30 views
3

我有麻煩正確安裝以下cocoapod: github.com/drmohundro/SWXMLHashiOS版的CocoaPods問題:在我的項目(自定義文件夾和Apple關注目標)的部分沒有這樣的模塊

有趣的是,我可以訪問由我的常規ViewController.swift中的窗格安裝的框架「SWXMLHash」,但無法在Apple Watch擴展文件中訪問它。此外,我不能在自定義組/文件夾來訪問它,我做封裝像WebServiceHelper.swift輔助方法

Overview of my folder structure (Image link)

我可以很容易地導入和使用由吊艙提供的框架在我ViewController.swift 對於iPhone。 但是,當我嘗試訪問它含有 「ViewController.swift」/ 「AppDelegate.swift」 的文件夾我得到以下錯誤:

No such module 'SWXMLHash'

Error when I try to access the framework in my "myAppName Kit"-folder (Image link)

我Podfile:

# Uncomment this line to define a global platform for your project 
# platform :ios, '8.0' 
# Uncomment this line if you're using Swift 
use_frameworks! 

source 'https://github.com/CocoaPods/Specs.git' 
platform :ios, '8.0' 

pod 'SWXMLHash', '~> 2.1.0' 

target 'myAppName' do 

end 

target 'myAppNameTests' do 

end 

target 'myAppNameUITests' do 

end 

target 'myAppName Watch' do 

end 

target 'myAppName Watch Extension' do 

end 

非常感謝您的幫助!

回答

1

請這樣

# Uncomment this line to define a global platform for your project 
# platform :ios, '8.0' 
# Uncomment this line if you're using Swift 
use_frameworks! 

source 'https://github.com/CocoaPods/Specs.git' 
platform :ios, '8.0' 



target 'myAppName' do 
pod 'SWXMLHash', '~> 2.1.0' 
end 

target 'myAppNameTests' do 

end 

target 'myAppNameUITests' do 

end 

target 'myAppName Watch' do 
pod 'SWXMLHash', '~> 2.1.0' 
end 

target 'myAppName Watch Extension' do 
pod 'SWXMLHash', '~> 2.1.0' 
end 
+0

感謝您的提示!不幸的是,它仍然在相應的部分顯示錯誤。 – Weiland

+0

你有更新豆莢,然後通過終端? – techloverr

0

podfile以下是我認爲你Podfile應該看(我只指定爲清晰起見,iOS和觀察目標,就需要包括取的有必要與每一個正確的平臺):

use_frameworks! 

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

target 'myAppName' do 
    platform :ios, '8.0' 
    pod 'SWXMLHash', '~> 2.1.0' 
end 

# snipped... 

target 'myAppName Watch' do 
    platform :watchos, '2.0' 
    pod 'SWXMLHash', '~> 2.1.0'  
end 

我沒加爲他們每個人,但要注意的是:platform指定不同的手錶目標。您不希望全球一級的ios目標。

希望這會有所幫助。

相關問題