4

I have an demo app that uses various internal development pods written in swift. All of the swift code in the development pods has trouble code completing. For example, when holding command and clicking on import UIKit, Xcode complains of a Symbol Not Found when tapping on UIKit. There's no compiler errors, everything builds and runs just fine.

If I have swift code outside of the pod in the demo project itself, that code completes just fine, but when I put it in a pod and run pod install, it either stops code completing immediately, or works for a few hours / pod update commands, and then randomly stops working. I have other development pods in my project, and those written in Objective-C have no trouble code completing ever.

I have tried multiple different solutions, namely the solutions listed here: Xcode 6 Swift code completion not working. None of these worked for me.

I tried various combinations of these solutions from the post above multiple times:

  • deleting Xcode's derived data
  • selecting a different simulator device to force a re-index
  • deleting Cocoapod's cache (both in the library and the Podfile.lock and Pods directory)
  • running pod deintegrate and then pod install
  • restarting Xcode and computer
  • using different versions of Xcode (6.3.2, 6.4, 7.0-beta2)
  • on a completely different machine

None of which seem to work.

Any help would be greatly appreciated!

Community
  • 1
  • 1
ranunez
  • 348
  • 2
  • 9

3 Answers3

5

This was also driving me crazy for a few hours, everything seemed fine, but the auto complete wasn't just working.

In my case I was using RestKit 0.25 with CocoaPods 0.39.0 on Xcode 7.2.1 (Since im still on Yosemite)

Since everything was compiling fine, I tried to find where the autocomplete feature kicks in, and I realised that there was something weird at the Project Build Settings level.

Of course it will compile and build fine if the Build Settings of your Target are correct, but what about the project one?

Just select YourProject->(PROJECT)YourProject->Build Settings-> Header Search Paths, and removed everything but "$(inherited)" non-recursive. Finally clean your project and autocomplete will be working again.

WilliamX
  • 357
  • 4
  • 17
  • Thanks! My Header Search Paths entry was completely empty somehow. I added "$(inherited)" non-recursive and autocompletion started working again. – Flitskikker Feb 10 '17 at 13:35
  • Thanks. Search paths were empty. Added to debug and release. Works great. – Sean Oct 14 '17 at 09:24
5

For me adding anything to the Build Settings didn't work, but deleting Derived Data and building the Pod scheme explicitely did the trick.

Go to "Manage Schemes" and check the Pods-MyProject scheme. Select this scheme (button next to the run and stop button) and Build for Running shift + cmd + R Switch back to your project scheme afterwards.

fruechtemuesli
  • 2,809
  • 3
  • 17
  • 15
-1

Try removing the following line in your Podfile, then pod install again:

use_frameworks!
Lizhen Hu
  • 814
  • 10
  • 16