1

Using pod dependencies, the import behavior is inconsistent.

This behavior is different on different machines for the same pods in Podfile. After successfully installing pods, my team came across the following two situations.

On one it worked through the #import statement in the bridging-header.h file but throws No such module '<moduleName>' error in the ViewController.swift file when tried that way. enter image description here

While on another mac it threw errors in the bridging.h file and worked through import <moduleName> in the ViewController.swift file. enter image description here

Both machines have Xcode 8.1, using Swift 3 syntax and cocoapods version is 1.1.1. We were able to re-create the issue multiple times.

Does anyone know why this happens and if there is some project setting which can be used to produce consistent reults?

Arjun Shukla
  • 337
  • 7
  • 10

1 Answers1

0

We have experienced this behaviour also. We could sometimes 'solve' it via: product>clean.

Sometimes we even had to quit+restart xcode and run clean again.

We agree, it is strange behaviour, probably xcode is losing state information or something.

Vincent
  • 4,342
  • 1
  • 38
  • 37
  • Thanks for your response. Are you on the same versions too? We had tried the possible _clean_ and _restart_ options before posting the question. We even updated one of the machines to Sierra but its still the same outcome. – Arjun Shukla Nov 15 '16 at 00:07