23

Admittedly, it's been awhile since I've run a pod update on my project. Today I was trying to do just that, and am running into issues.

After running a 'pod update', the project will not compile. Here is what I've noticed. The update itself appears to run fine, just like normal. I did notice that all the files in 'Pods/Target Support Files` have been removed.

When I attempt to build, I get an error like this one for most of my pods:

lang: error: no such file or directory: '/Users/logan/development/ProjectNameRemoved/src/Pods/Target Support Files/Pods-AJNotificationView/Pods-AJNotificationView-dummy.m'

clang: error: no input files

When I go to the Build Phases for the pods with this error, I can see that the dummy .m file is still in there, even though it doesn't exist: dummy file

Removing all of those doesn't seem to help, as then I start getting the following errors:

second error

Digging down into the target's settings I can see the GCC prefix header is still set to use a nonexistent pch file:

prefix header

I'm not really sure where to go from here. It seems like pod update is removing certain files, but my pbxproj is not being updated to correlate these changes. Do I need to figure out how to do this manually?

I'm currently running XCode7 and CocoaPods 0.38.2

LLooggaann
  • 425
  • 1
  • 4
  • 16
  • 1
    We never ended up really "solving" our problem. In the end, we had to start from scratch with CocoaPods. I used https://github.com/kylef/cocoapods-deintegrate to remove Cocoapods, and then used our old podfile to run a fresh pod install. We were met with a lot of errors we solved through http://stackoverflow.com/questions/23539147/xcode-ld-library-not-found-for-lpods and https://github.com/CocoaPods/CocoaPods/issues/2053 . Overall, CocoaPods has consumed more time then it has saved in the past 12 months. We're going to move forward without it. – LLooggaann Oct 07 '15 at 18:35
  • delete pods folder along with pod.lock file then do pod install worked for me – Ajay S Oct 11 '19 at 07:57

4 Answers4

35

I encountered this problem when I was refactoring a project. After removing a CocoaPod, I had remnants of it that were referenced. Cleaning caches and rebuilding did not resolve the issue.

I was able to resolve it using cocoapods-deintegrate referenced in the user's comment above.

Steps to resolve:

  1. Close the project in Xcode so you don't have Xcode throwing warnings at you about differences between versions (assuming you're using version control, which is a good idea if you're messing with CocoaPods).

  2. Install cocoapods-deintegrate by typing in Terminal:

    gem install cocoapods-deintegrate

  3. Type pod deintegrate from the directory of your project.

  4. Open the project in Xcode, clean caches and rebuild. Your Podfile should still be there...leave it alone. We'll get to that in a moment.

  5. Close the project.

  6. Type pod install

  7. Open the project, clean caches and rebuild.

These are the steps I followed to resolve this issue.

Update:

I also used this methodology to resolve a linker error which cropped up when I deleted a reference to a class file instead of the file itself. Upon doing that, I got this error:

error: linker command failed with exit code 1 (use -v to see invocation)

Community
  • 1
  • 1
Adrian
  • 16,233
  • 18
  • 112
  • 180
  • 1
    Yeah, that's what we did as well, so I'll give you the accepted answer. That being said, we've switched to Carthage and never looked back to CocoaPods. – LLooggaann Sep 05 '16 at 07:30
  • Nice - these steps also worked for me in React Native. (The Target Support Files directory was empty when building.) – Freewalker May 12 '17 at 19:08
  • Life saver man, I used to resolve my linker errors. I have the same problem after updating my projects cocoapod files, It shows me liker error for the files which was not existing. Thanks for the answer. – Arpit B Parekh Jul 22 '17 at 10:22
  • "When I go to the Build Phases for the pods with this error, I can see that the dummy .m file is still in there, even though it doesn't exist: " quoted in question, this was my error. – Arpit B Parekh Jul 22 '17 at 10:23
  • @Adrian, I did not get to follow this to the letter but I followed your steps as closely as possible and it worked, I finally got a successful build in `ios` again. – Daniel Jul 30 '19 at 00:34
  • @Daniel Great to hear. Looking forward to SPM obviating the need for CocoaPods :) – Adrian Jul 30 '19 at 02:00
  • @Adrian, if I need to change the `targets` to my `Podfile` should I follow your steps above as well? Or does the answer require I officially post as a question? – Daniel Jul 30 '19 at 03:03
  • Without knowing more about what your Podfile looks like, I'd post as a standalone question. Frankly, if you've really ****ed it up, I'd start over again with a factory fresh Podfile. – Adrian Jul 30 '19 at 03:05
  • @Adrian, https://stackoverflow.com/questions/57263793/how-to-properly-update-my-targets-on-podfile?noredirect=1#comment101026597_57263793 – Daniel Jul 30 '19 at 13:01
3

You can try

pod deintegrate
pod install

*You should be located at Podfile directory

yoAlex5
  • 29,217
  • 8
  • 193
  • 205
0

Can you see if the answer in this post can help?

Xcode install on OSX 10.9 - clang: error: no input files

I would try reconstructing my project.

Community
  • 1
  • 1
Patrice Gagnon
  • 1,276
  • 14
  • 14
  • I can solve the input files error, it exposes the pre-compiled header error after... Finally if I solve that then the libraries don't work anymore. Assuming because they're missing the pch. – LLooggaann Oct 05 '15 at 20:03
0

I just got the same thing after re configuring my podfile to accommodate multiple targets. I was just going to use the suggested answer above, but before doing anything I committed my changes in git. That solved the problem. The git commit included lots of file deletions and additions done by cocoapods, so I guess some things were still hanging around.

George Brown
  • 1,134
  • 10
  • 25