0

Pardon me for beginner's question, I tried to install a library named NetworkKit, and follow their instruction by doing

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

pod 'NetworkKit'

and then

pod install

but still in the swift file, I got the error "No such module" at the line import NetworkKit.

Any idea how to fix this? Thanks

Update: This is the output of 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.

Update 2:

The answer is in Thanh Pham's and Shayan Jali's comment: I have to open xcworkspace after install the pod, instead of the xcproject

Community
  • 1
  • 1
EyeQ Tech
  • 7,198
  • 18
  • 72
  • 126

3 Answers3

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.

The NetworkKit isn't configured with the latest swift syntax. So, use this link Xcode 8 Beta 3 Use Legacy Swift issue to resolve it.

Community
  • 1
  • 1
Sachin Vas
  • 1,757
  • 12
  • 16
0

Let me put the answer here for future readers:

The output of pod install --verbose indicates that the pod has been installed successfully. However, you have to open the .xcworkspace file generated by CocoaPods instead of the .xcproject file.

It is also worth mentioned that the pod can be compiled on Xcode 7 but not Xcode 8 since it has not been updated to Swift 2.3 nor 3.0 at the time of this post.

Thanh Pham
  • 2,021
  • 21
  • 30
-1

It is import NewsstandKit, the import NewtworkKit is not working.

Sachin Vas
  • 1,757
  • 12
  • 16