I posted my trouble on Stack Overflow, to which I was told by others experiencing this as well to post a bug report.
I have a project that uses various private internal pods, and upon installing them locally as Development Pods, those written in Swift have trouble code completing. Xcode complains of a "Symbol Not Found" when command clicking, even on import Foundation
. Everything complies and runs fine with no errors.
As soon as I install them from remote and not as Development Pods however, everything code completes with no issues.
I have tried various solutions, namely:
Any help would be greatly appreciated!
Same issue, really frustrating.
I have the same issue as well. Is anyone looking into this from the cocoapods team?
I experience this issue when I specify my path using a symlink
pod "PodName", :path => "symlinkToDesktop/MyLibrary"
but if I specify the path with a tilde, this problem seems to go away for me
pod "PodName", :path => "~/Desktop/MyLibrary"
Where did you specify this path? can you please guide me?
In the Podfile
@ranunez Interesting — so it seems this is an Xcode issue regarding symlinks and a potential solution would be expanding them to realpath within CP before adding files to the Xcode project
Have you added keyword "public" in front of class name?
For example
"Public class mycustomviewcontroller"
The word public allows the class to be found outside its cocoapod module.
@keyclipse Yes I have, this makes no difference. It fails to code complete within the module, not outside.
@neonichu What makes you think that this is an issue with Xcode and not with CP itself?
Unfortunately, I can't reproduce this behaviour, even when referencing the development pod via a symlink. One of you has to provide an example project which exhibits this to further look into it.
Hey @neonichu here is the demo project with instructions https://github.com/starback/BrokenCocoapods
I am also able to reproduce this behavior using @starback's demo project
Thanks for the example, this branch contains a workaround, please verify it with your actual projects as well. You can follow this guide to do that.
I think this should still also be reported as an Xcode bug, it doesn't make sense that adding a file via a directory symlink should lead to such issues.
@neonichu That works! Thanks! :+1:
For what it's worth, I believe Xcode 7 Beta 6 fixes the symlink issue.
Can anyone check if the latest Xcode fixes things? Thanks!
Unfortunately, Xcode 7 Beta 6 did not fix this issue for me, even after deleting derived data, reindexing, restarting Xcode, etc
With XCode 7.1, this issue still exists. I tried adding the ':path => ...' to Podfile as well, to no avail.
This workaround seems to be working.
Add the path of individual libraries as "non-cursive" path in "Framework Search Paths" under build settings.
It definitely seems to be an XCode bug, as the "recursive" option to include just the path to project dir doesn't seems to work. Attaching screenshot :
EDIT : Adding path to Podfile never worked for me
Can anyone verify that @neonichu's fix indeed fixes things?
Adding path to Podfile worked for me.
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 with CocoaPods.
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.
BTW, you need to include the quotation marks when typing "$(inherited)"
. Wasted a few hours trying to figure out why this wasn't working...
@keyclipse YOU ARE MY HERO, I was struggling for 2 hours until I read your suggestion. Thanks a lot
In my case , i just uncheck the membership option for test targets and auto complete is Back!!
(also you could remove them all in test targets's compile file list )
Most helpful comment
Have you added keyword "public" in front of class name?
For example
"Public class mycustomviewcontroller"
The word public allows the class to be found outside its cocoapod module.