最新消息:20190529 VPS服务器已从腾讯云香港换为Vultr新加坡,主题仍用朋友推荐的大前端D8

【已解决】Xcode中导入Carthage编译的库报错:Module compiled with Swift 2.3 cannot be imported in Swift 3.0

Carthage crifan 562浏览 0评论

代码:

import XCGLogger

报错:

/Users/crifan/dev/dev_root/crifan/FeeeShadowsocks/FreeShadowsocks/FreeShadowsocks/GlobalFunctions.swift:11:8: Module compiled with Swift 2.3 cannot be imported in Swift 3.0: /Users/crifan/dev/dev_root/crifan/FeeeShadowsocks/FreeShadowsocks/Carthage/Build/iOS/XCGLogger.framework/Modules/XCGLogger.swiftmodule/i386.swiftmodule

如图:

此处的导入库:

是Carthage update去编译出来的

用的配置是:

github "DaveWoodCom/XCGLogger"

另外,也知道:

Use Lagacy Swift Language Version,默认为No

也不能去改为Yes

-》否则就要求所有的库,包括其它的库,都是swift 2.x,比如swift 2.3的才可以

否则就无法导入,出现类似错误

去看了XCGLogger的官网,看到有对应的swift的版本的tag:

所以就去使用对应的swift_3.0的分支的:

github "DaveWoodCom/XCGLogger" "swift_3.0"

然后再去重新编译

是可以正常编译的:

*** Building scheme "XCGLogger (iOS)" in XCGLogger.xcodeproj
2016-10-15 22:37:10.123 xcodebuild[28351:1959314] [MT] PluginLoading: Required plug-in compatibility UUID 8A66E736-A720-4B3C-92F1-33D9962C69DF for plug-in at path ‘~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/WCGitTagsPlugin.xcplugin’ not present in DVTPlugInCompatibilityUUIDs
2016-10-15 22:37:10.123 xcodebuild[28351:1959314] [MT] PluginLoading: Required plug-in compatibility UUID 8A66E736-A720-4B3C-92F1-33D9962C69DF for plug-in at path ‘~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/RealmPlugin.xcplugin’ not present in DVTPlugInCompatibilityUUIDs
2016-10-15 22:37:10.124 xcodebuild[28351:1959314] [MT] PluginLoading: Required plug-in compatibility UUID 8A66E736-A720-4B3C-92F1-33D9962C69DF for plug-in at path ‘~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/Alcatraz.xcplugin’ not present in DVTPlugInCompatibilityUUIDs
2016-10-15 22:37:33.157 xcodebuild[28445:1959609] [MT] PluginLoading: Required plug-in compatibility UUID 8A66E736-A720-4B3C-92F1-33D9962C69DF for plug-in at path ‘~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/WCGitTagsPlugin.xcplugin’ not present in DVTPlugInCompatibilityUUIDs
2016-10-15 22:37:33.157 xcodebuild[28445:1959609] [MT] PluginLoading: Required plug-in compatibility UUID 8A66E736-A720-4B3C-92F1-33D9962C69DF for plug-in at path ‘~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/RealmPlugin.xcplugin’ not present in DVTPlugInCompatibilityUUIDs
2016-10-15 22:37:33.158 xcodebuild[28445:1959609] [MT] PluginLoading: Required plug-in compatibility UUID 8A66E736-A720-4B3C-92F1-33D9962C69DF for plug-in at path ‘~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/Alcatraz.xcplugin’ not present in DVTPlugInCompatibilityUUIDs

然后就可以解决此问题了。

转载请注明:在路上 » 【已解决】Xcode中导入Carthage编译的库报错:Module compiled with Swift 2.3 cannot be imported in Swift 3.0

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
64 queries in 0.079 seconds, using 19.22MB memory