Ios Watchkit扩展中的SwiftyJSON不工作
在XCode-7.2下使用iOS-9.2、watchOS-2.1、Swift-2.1.1: 试图在我的Watchkit扩展中使用SwiftyJSON(v2.3.2)!SwiftyJSON的安装是通过以下pod文件完成的: 播客文件:Ios Watchkit扩展中的SwiftyJSON不工作,ios,json,cocoapods,watchkit,Ios,Json,Cocoapods,Watchkit,在XCode-7.2下使用iOS-9.2、watchOS-2.1、Swift-2.1.1: 试图在我的Watchkit扩展中使用SwiftyJSON(v2.3.2)!SwiftyJSON的安装是通过以下pod文件完成的: 播客文件: xcodeproj 'TableTestKOS001.xcodeproj' workspace 'TableTestKOS001.xcworkspace' platform :ios, '9.0' inhibit_all_warnings! use_framewo
xcodeproj 'TableTestKOS001.xcodeproj'
workspace 'TableTestKOS001.xcworkspace'
platform :ios, '9.0'
inhibit_all_warnings!
use_frameworks!
link_with 'TableTestKOS001', 'TableTestKOS001 WatchKit Extension'
def shared_pods
pod 'SwiftyJSON', :git => 'https://github.com/SwiftyJSON/SwiftyJSON.git'
end
target 'TableTestKOS001' do
shared_pods
end
target 'TableTestKOS001Tests' do
shared_pods
end
target 'TableTestKOS001 WatchKit Extension' do
platform :ios, '9.0'
shared_pods
end
使用“pod安装”,我得到:
这告诉我,到目前为止一切都很好
之后,我打开项目(不是使用.proj文件),而是使用新创建的工作区文件(例如,在我的示例中是TableTestKOS001.xcworkspace)
现在问题开始了:
一旦我将SwiftyJSON“导入我的WatchKit扩展的任何WKInterfaceControllers中,我就会得到以下错误(即“没有这样的模块SwiftyJSON”)
此外,在上述错误旁边,我得到以下警告:
有人能帮忙吗??
感谢您的支持
另外,当我将SwiftyJSON导入任何iOS目标的ViewController时,也会出现相同的错误和警告…我设法通过以下方式修复了它: -更新cocoapods,然后修改
Podfile
以指定平台
target 'My App' do
pod 'Google/Analytics'
pod 'SwiftyJSON', :git => 'https://github.com/SwiftyJSON/SwiftyJSON.git'
end
target 'My App Watch Extension' do
platform :watchos, '2.0'
pod 'SwiftyJSON', :git => 'https://github.com/SwiftyJSON/SwiftyJSON.git'
end
- 然后再次运行
pod安装
- 最后,通过单击窗口->项目->选择您的项目来清除项目数据,并删除派生数据
Podfile
以指定平台
target 'My App' do
pod 'Google/Analytics'
pod 'SwiftyJSON', :git => 'https://github.com/SwiftyJSON/SwiftyJSON.git'
end
target 'My App Watch Extension' do
platform :watchos, '2.0'
pod 'SwiftyJSON', :git => 'https://github.com/SwiftyJSON/SwiftyJSON.git'
end
- 然后再次运行
pod安装
- 最后,通过单击窗口->项目->选择您的项目来清除项目数据,并删除派生数据