I have a project that's using several custom frameworks. These custom frameworks have some pods as dependencies like Alamofire, SwiftKeychainWrapper, etc., so I have these installed in my main project.
Everything works just fine until I try to install a new pod ('RealmSwift') that a new custom framework has a dependency on. After I install it I get this error:
diff: /Podfile.lock: No such file or directory
diff: /Manifest.lock: No such file or directory
error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.
I'm able to resolve this by adding two USER_DEFINED build settings for PODS_PODFILE_DIR_PATH and PODS_ROOT (but why did running pod install change this?)
Then when I try to build, all my custom frameworks that have pods as dependencies give this error when trying to import:
Example:
Missing required modules: 'Alamofire', 'SwitfKeychainWrapper', etc.
Why can't Xcode see these modules? They're exactly where they were before.
I've tried everything to resolve this. Cleaning, deleting derived data, deintegrating my pods and reinstalling all of them, editing the import paths and header search paths, nothing seems to work.
I'd be so grateful for any help!
It seems to your pod require to update.
Please execute this command.
'pod update'
Add Alamofire and SwitfKeychainWrapper into your embedded libraries. Usually this solves the problem but still if it doesn't, then try to add both of them in Linked Framework and Libraries as well as embedded libraries.
I finally figured this out. When I ran pod install, it was completely changing my build settings. Particularly, it was changing the path of where to find the Pods.xcconfig files.
If you go to Project (above Targets) -> Info -> Configurations you should see Debug and Release xcconfig files for Pods. If Xcode can't find these files, it won't be able to use any pods.
So my solution was to just discard all changes to my project file (where build settings are managed) after running pod install.
Related
I downloaded a zip of my own project from github but keep running into an error on building it. 2 out of 5 libraries I installed using cocoapods, though present in the pods folder, aren't identified by Xcode, specifically, SDWebImage and YTPlayerView.
Can anyone tell me how to fix this?
As intboolstring said, ensure you run pod install inside the directory of the project you have downloaded, however what I have found is that you should also build the project after running pod install, as it sometimes does not link the pods to the project. Do this using the .xcworkspace file.
When downloading a git project, the project comes with the Podspec file, which specifies which dependencies need to be downloaded. To download the required dependencies for your project, you can run
pod install
Also, to make sure that the dependencies are loaded, open the .xcworkspace file. If you can't find the workspace, you can go to your project directory and run
open `ls | grep xcworkspace`
I fixed the problem with the pods. Adding import pod name to the affected classes fixed it.
For some reason, the local copy of the app works fine, even without said import statements.
I have create 3 project target (Development, Production and Staging).Expect Production other working fine after pull the changes of others while building the production target xcode giving the error :
gone through some of the available solution but no success!!!
If you change something the conflict will be occur, do like remove your WorkSpace once and again install or update your Pods,it will Work
Run pod install or pod update your CocoaPods installation.
For additional Information see this1
Choice-2
there's a problem with Cocoapods in your project. Sometimes cocoapods can get out of sync and you need to re-initiate cocoapods. You should be able to resolve this error by:
Deleting the Podfile.lock file in your project folder
Deleting the Pods folder in your project folder
Execute pod install in your project folder
Do a Clean in Xcode
Rebuild your project
Conclusion: don't run pod install while project opened in the Xcode.
Update answer
I. Project Cleanup
In the project navigator, select your project
Select your target
Remove all libPods*.a in Linked Frameworks and Libraries
II. Update CocoaPods
Launch Terminal and go to your project directory.
Update CocoaPods using the command pod install
I have solved my problem by this way :
After implementing lot many solution i got this error :
By removing Check pods manifest.lock, Copy pods resources and Embed pods frameworks from Build Phases of Tests project target(xxxTests) i solved the issue.
NOTE: If any one still getting any issue related to pods, then try to remove libpods-xxx.a from Link Binary with libraries and again add it.
The Problem
I recently started working on a project.
Which Uses Cocoa Pods as the dependency manager.
It also uses Crashlytics for crash reporting.
Image Magick for Icon generation and Synx for reorganizing the project folder.
I was given Git access.
So I cloned the repo.
did a pod install
and compiled the code but it started giving me following error.
Project target is iOS 7.
Cocoa Pods Version is 0.36.4 also tried Latest 0.38.2
It is an iphone only app.
What I have done So far trying to solve this issue
So I sat down with the Original developer who was very helpful and had a working copy of the code on his machine. As it was a code handover so he was helping me setting it up on my machine.
We have tried all the usual suspects.
Clean and Build
Clean Quit Xcode Reopen and build
Quit xcode delete the Pods Directory and do a pod install
pod setup
pod update
Checked PODS_ROOT paths for different build configurations with working copy on another machine where it compiles correctly
My pods were latest so I uninstalled cocoapods using sudo gem uninstall cocoapods and installed the version the original developer had sudo gem install cocoapods -v 0.36.4
Matching Xcode versions xcode 6.4
Checking Configurations under Info in Project
Another pull from Github at a different location and doing all above steps.
Clear Xcode derived data folder.
So basically we checked all this retried all the above steps many times and also verified project settings build phases etc.
code is running fine on his machine.
Some weird behaviour i noticed was that one time instead of above mentioned error in picture it gave the famouse xyz.h file not found error for one of the libraries in Pods. But doing a pod install reverted back to original error.
Any ideas?
I remember this one.. I think it is due to cocopods changed the directory of there "copy pods resources" shell script from one version to the other. Look under your targets build phases and check for a "run script" entry i think. Look at the path and then check in finder to see where the shell script is really located.
Not really certain of the details... it might have been one of the other cocopods enters in the build phase section. Look around there, I do remember it was pretty easy to spot when you know where to look.
Should probably be the "Check Pods Manifest.lock" section under Build Phases.
Make sure you are opening workspace project(.xcworkspace) instead of XCode Project..
Else
Remove podfile.lock
Remove Pods Folder
Remove .xcworkspace
Remove manifest.lock (if exists)
Go to path of pod file and Run pod install
Then it will generate .xcworkspace.
Now onwards you need to use workspace instead of xcodeproj
Hope it helps you..!
All my targets use the same libraries, so I use link_with to make my podfile neat. But to my surprise the project compiled failed. Xcode complains it can't find some files in pod, e.g.
diff: /../Podfile.lock: No such file or directory diff:
/Manifest.lock: No such file or directory error: The sandbox is not in
sync with the Podfile.lock. Run 'pod install' or update your CocoaPods
installation.
And
'DDLog.h' file not found
I run pod install again and clean xcode again and again. But no luck. I was not able to figure out why. From what I can see cocopods only changed shellScript for each target to one single Pods-resources.sh, which is what link_with is supposed to do, right?
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-CloudPhone/Pods-"my target"-resources.sh\"\n";
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-resources.sh\"\n";
Is this a cocopods's bug? I am using latest one 0.37 and now I went back to specify each target individually.
Update:
CocoaPods 1.0 has removed link_with in favour of abstract_target
I think this is a pods bug. The pods doesnot update the script location, when a project specify target specific configuration initially and later tries to combine it.
To fix, go to Build phases->Embedd pod framework-> update the script file location to reflect the universal pod folder (like /Pods/Pods-frameworks.sh"). [You can navigate in finder to find exactly where the sh is present]. Remove any other script which doesn't reflect in physical folder. Now the project should compile.
Quick solution: remove Embed Pod Frameworks and run pod install again
Came across the same error. Just want to add to Sukitha's Answer.
Go to build phase -> Embed pod framework -> $SRCROOT
Be sure to check that this SRSCROOT file block correctly leads up to the frameworks.h file.
You will need to edit in order to correct issue.
Cheers
I recently had to delete a xcode project from my computer and re-clone it down. After cloning it, I ran a pod install and then went to build the project. However, I kept hitting a error in my .pch file that claimed a file (a pod file) was not found.
I looked into the following SO posts:
iOS - Build fails with CocoaPods cannot find header files
Unit Test build failing when importing MagicalRecord
From there I gathered that I needed to add to Header Search Paths the $(inherited) flag. I've done that, I've cleaned the project, and then re-built it, and still am having the following error..
As of version 2.3.0 (released on 1 June 2015) the file CoreData+MagicalRecord.h seems to have been renamed to MagicalRecord.h only.
If you installed MagicalRecord using CocoaPods and ran pod install or pod update again you might have gotten this new version and will end up with the same error message: CoreData+MagicalRecord.h file not found
So you should change the import of the header in your pch file then. This is what I have now:
Try to add this line on top of your podfile:
link_with ['ProjectName', 'ProjectNameTests']
before this line
platform :ios, '8.0'
Install pod, and at your project Build Setting->Other Linker Flags, add $(inherited).
import "MagicalRecord/MagicalRecord.h"
Try to run command (1) in terminal, then add import in step (2)
In your project directory,run pod update
You should now be able to add
#import <MagicalRecord/CoreData+MagicalRecord.h>
to any of your target's source files and begin using MagicalRecord!
I think with 2 steps you can be solved this problem.