原谅我的初学者问题,
我尝试安装名为NetworkKit
的库,然后按<{3}}执行
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
pod 'NetworkKit'
然后
pod install
但仍然在swift文件中,我在行import NetworkKit
处收到错误“No such module”。
知道怎么解决这个问题吗?感谢
更新:这是pod install --verbose
Analyzing dependencies
Inspecting targets to integrate
Using `ARCHS` setting to build architectures of target
`Pods-networkingexamle`: (``)
Using `ARCHS` setting to build architectures of target
`Pods-networkingexamleTests`: (``)
Using `ARCHS` setting to build architectures of target
`Pods-networkingexamleUITests`: (``)
Finding Podfile changes
- NetworkKit
Resolving dependencies of `Podfile`
Comparing resolved specification to the sandbox manifest
- NetworkKit
Downloading dependencies
-> Using NetworkKit (1.3.2)
- Running pre install hooks
Generating Pods project
- Creating Pods project
- Adding source files to Pods project
- Adding frameworks to Pods project
- Adding libraries to Pods project
- Adding resources to Pods project
- Linking headers
- Installing targets
- Installing target `NetworkKit` iOS 8.0
- Generating Info.plist file at `Pods/Target Support
Files/NetworkKit/Info.plist`
- Generating module map file at `Pods/Target Support
Files/NetworkKit/NetworkKit.modulemap`
- Generating umbrella header at `Pods/Target Support
Files/NetworkKit/NetworkKit-umbrella.h`
- Installing target `Pods-networkingexamle` iOS 8.0
- Generating Info.plist file at `Pods/Target Support
Files/Pods-networkingexamle/Info.plist`
- Generating module map file at `Pods/Target Support
Files/Pods-networkingexamle/Pods-networkingexamle.modulemap`
- Generating umbrella header at `Pods/Target Support
Files/Pods-networkingexamle/Pods-networkingexamle-umbrella.h`
- Installing target `Pods-networkingexamleTests` iOS 8.0
- Generating Info.plist file at `Pods/Target Support
Files/Pods-networkingexamleTests/Info.plist`
- Generating module map file at `Pods/Target Support
Files/Pods-networkingexamleTests/Pods-networkingexamleTests.modulemap`
- Generating umbrella header at `Pods/Target Support
Files/Pods-networkingexamleTests/Pods-networkingexamleTests-umbrella.h`
- Installing target `Pods-networkingexamleUITests` iOS 8.0
- Generating Info.plist file at `Pods/Target Support
Files/Pods-networkingexamleUITests/Info.plist`
- Generating module map file at `Pods/Target Support
Files/Pods-networkingexamleUITests/Pods-networkingexamleUITests.modulemap`
- Generating umbrella header at `Pods/Target Support
Files/Pods-networkingexamleUITests/Pods-networkingexamleUITests-umbrella.h`
- Running post install hooks
- Writing Xcode project file to `Pods/Pods.xcodeproj`
- Generating deterministic UUIDs
- Writing Lockfile in `Podfile.lock`
- Writing Manifest in `Pods/Manifest.lock`
Integrating client project
Integrating target `Pods-networkingexamle` (`networkingexamle.xcodeproj` project)
Integrating target `Pods-networkingexamleTests` (`networkingexamle.xcodeproj` project)
Integrating target `Pods-networkingexamleUITests` (`networkingexamle.xcodeproj` project)
- Running post install hooks
- cocoapods-stats from
`/Library/Ruby/Gems/2.0.0/gems/cocoapods-stats-1.0.0/lib/cocoapods_plugin.rb`
Sending stats
- NetworkKit, 1.3.2
Pod installation complete! There is 1 dependency from the Podfile and 1 total
pod installed.
[!] Your Podfile has had smart quotes sanitised. To avoid issues in the future, you should not use TextEdit for editing it. If you are not using TextEdit, you should turn off smart quotes in your editor of choice.
更新2:
答案是在Thanh Pham和Shayan Jali的评论中:我必须在安装pod之后打开xcworkspace,而不是xcproject
答案 0 :(得分:0)
“Use Legacy Swift Language Version” (SWIFT_VERSION) is required to be configured correctly for targets which use Swift. Use the [Edit > Convert > To Current Swift Syntax…] menu to choose a Swift version or use the Build Settings editor to configure the build setting directly.
NetworkKit未配置最新的swift语法。因此,请使用此链接Xcode 8 Beta 3 Use Legacy Swift issue来解决此问题。
答案 1 :(得分:0)
让我在这里为未来的读者提供答案:
pod install --verbose
的输出表示已成功安装pod。但是,您必须打开由CocoaPods而不是.xcproject文件生成的.xcworkspace文件。
值得一提的是,pod可以在Xcode 7上编译,但不能在Xcode 8上编译,因为在本帖子发布时它尚未更新为Swift 2.3或3.0。
答案 2 :(得分:-1)
import NewsstandKit
,import NewtworkKit
无效。