Why pod library still can be used after i delete it from Podfile? - xcode

I added this into my Podfile:
pod 'RDVTabBarController'
Then I ran pod install. Then I added import RDVTabBarController on my view controller and all works well.
I removed pod 'RDVTabBarController from the Podfile, then ran pod install again. Why can I still use it on my ViewController? Is RDVTabBarController still installed as a reference on my computer?

If you run pod update it should remove it from your project. I would also run a Clean from within Xcode to ensure that all build stages are started over from scratch.

Related

framework not found GoogleMapsCore Error

I'm using cocoapods in my project and I have googlemaps(2.5.0) and googleplaces(2.5.0) in my podfile(which I've installed with 'pod install').
However, I'm getting this error when I try to build:
ld: framework not found GoogleMapsCore
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I've changed 'Build Active Architecture Only' to NO in my Build Settings. I'm also in my project.xcworkspace NOT my project.xcodeproj file. I've even tried changing my valid architectures but none of this is working.
It might be helpful to note that, inside my workspace Project Navigator, for some reason I have my project.xcodeproj file in red. project.xcodeproj is usually never there let alone red.
Finally a solution:
pod deintegrate
pod install
I had to reclone my Git project(because I had tried too many solutions to backtrack through new warnings and errors) then I just did the above commands in terminal.
Though #Sam King's solution worked for me, I considered it as a hard fix without knowing the actual issue.
The issue for my case was, I had accidentally deleted the GoogleMapsCore framework(Might be from 'Manage System Storage').
So, I just checked out an older version of my app and the issue got fixed.
For those using Ionic Framework,
Remove googlemap plugin and install again. It worked for me.
Had the same problem after deleting GoogleMapsCore by mistake. and here's what worked for me:
From my project podfile , commented out the pods related to google maps, in my case
//rn_maps_path = '../node_modules/react-native-maps'
// pod 'react-native-google-maps', :path => rn_maps_path
// pod 'GoogleMaps'
// pod 'Google-Maps-iOS-Utils'
cd ios && pod install , to remove the pods i commented out
then i uncommented the pods i have commented earlier in step 1
cd ios && pod install to install the pods again
ran a clean build on xcode and it worked.
Remove googlemap related plugin and install again. It worked for me.
Please dont do deintegrate pod, if you do all libraries get install as new, that some how some libraries would not support your platform.
The better solution is to install the google places along with the GoogleMaps pod it will definitely work
Try this
pod 'GoogleMaps'
pod 'GooglePlaces'
if it doesn't work then open the terminal and do this below steps for your project
pod deintegrate
pod install
then
pod 'GoogleMaps'
pod 'GooglePlaces'

Creating a pod with cocoapods fails

I've just tried to create a pod using pod lib create Test and went with all the defaults. However, when it is done asking me questions I get:
Running pod install on your new library.
[!] No `Podfile' found in the project directory.
Ace! you're ready to go!
We will start you off by opening your project in Xcode
open 'Test/Example/Test'
The file /Users/macattack/Documents/Xcode/Test/Example/Test.xcworkspace does not exist.
I don't understand what I've done wrong.
I'm using XCode 8, cocoapods 1.1.0.rc.2.
Following is working on Cocoapods 1.1.0.rc.2 version.
You haven't done anything wrong. It's a pre-release version, just a few more steps required.
Podfile is already there, but in the Example folder. Open terminal, proceed to Example folder:
cd [path]
You can just drag&drop the folder after 'cd' letters to paste the path.
Then just run pod install.
Open workspace, Xcode will prompt you to update to last Swift syntax version and update version property.
If you are using Swift 3 there is another option, suggested by authors (Issue 5841).
Create a .swift-version file in pod parent folder. Run echo "3.0" >> .swift-version
Create pod with pod lib create [pod name].
Proceed to pod Example folder and run pod install
Hope it helps!
Artem

How to install ConvenienceKit Framework via Podfile Swift

I've tried multiple methods and Xcode versions to install this method and use it but every time when i use import ConvenienceKit it always fails by saying "No such module ConvenienceKit"
https://github.com/MakeSchool/ConvenienceKit
it can be installed by using use_frameworks! in the Podfile and pod 'ConvenienceKit'. Everything installs fine, just doesn't work.
What am i missing ?
To use pods use have to work in a 'workspace' with the the pod that you are using. If you are using a workspace and it is sill not working you can try the following:
Check to see if there is a update for CocoaPods
Check to see if there is a update for Xcode
Uninstall Xcode and re install it.
Hope this works.

Incorrect path for Pods.debug.xcconfig in Xcode?

so I used Venmo/Synx on my Xcode project with CocoaPods, and it completely screwed everything up.
I was able to fix the Manifest.lock and Podfile.lock errors, but now I am getting this error:
The file “Pods.debug.xcconfig” couldn’t be opened because there is no such file. (/Users/user/GitHub/xxxxxx/Pods/Pods/Target Support Files/Pods/Pods.debug.xcconfig)
As you can see, the path is incorrect, as there is no Pods/Pods directory (there is one extra pod).
How can I fix this? I have only added PODS_ROOT to the user-defined variable, as that fixed my Podfile and Manifest.lock files.
Any help would be much appreciated!
Edit:
After adding PODS_ROOT, I get this when running pod install.
[!] The `Project [Debug]` target overrides the `PODS_ROOT` build setting defined in `Pods/Target Support Files/Pods/Pods.debug.xcconfig'. This can lead to problems with the CocoaPods installation
- Use the `$(inherited)` flag, or
- Remove the build settings from the target.
I had the same problem in Xcode 6.1.1. I did the following to solve it:
Set the configuration file setting* "None" for the Pods related target.
Close the .xcworkspace.
run pod install again
now open and build your .xcworkspace
*The configuration file setting is found by selecting the project (not the target) and then the Info tab.
If your path to pods in error is wrong try this:
use pod deintegrate
delete all pod remains files - Podfile.lock, Pods, <Project>.xcworkspace
open <Project>.xcodeproj
remove Pods project on left side
try pod install
I had the same problem with Xcode 11 but I just updated CocoaPods and it worked.
Update CocoaPods to latest version with sudo gem install cocoapods
Run pod install again
I had the same error while trying to build my project for the first time. This is how I resolved it:
pod deintegrate
sudo gem install cocoapods-clean
pod clean
Open the project and delete the “Pods” folder that should be red.
pod setup
pod install
Reopen and build the project, I think it's good to go!
I faced this issue when I upgraded/downgraded cocoapods between 1.6.x and 1.5.x.
The following step fixed this error
1, go to project info tab
2, just under Deployment target, there is configurations field. change your configuration. In my case, there are 2 options
/Users/user/GitHub/xxxxxx/Pods/Pods/Target Support Files/Pods/Pods.debug.xcconfig
/Users/user/GitHub/xxxxxx/Pods/Target Support Files/Pods/Pods.debug.xcconfig
3, clean and build again.
1- Remove your Pods folder Podfile.lock and xcworkspace files root in your project.
2- Open .xcodeproj
3- Go to Build Settings and under Build Options search Always Embed Swift Standard Libraries
4- Update its value with $(inherited)
5- Close project and pod install again
There has been an update to cocoa pods that is causing this problem. Please refer to the cocoa pods release notes :
Change shell script relative paths to use ${PODS_ROOT} instead of ${SRCROOT}/Pods.
Whirlwind #7878
This was done in version 1.6.0.beta.1 (2018-08-16)
Release notes are here: cocoapods release notes
I had the same error and I fixed in following way
1 - Goto your projected setting by blue icon of your project from left pan
2 - Select your project under the project
3 - Select Info window
4 - Check IOS deployement target. This target should be same as you set in general settings of your project (Pic 2).
I got the same situation in Xcode 10.1. This is what works for me.
Open <Project>.xcworkspace
Go into your <project_name> folder(by default it's blue), delete the Pods folder (by default it's yellow)
In Terminal.app, run pod install again
Then I'm able to CMD + R to run the simulator
A few things worth trying:
As Keith mentioned above, you definitely want to exclude Pods from synx.
You almost certainly do not want to override the PODS_ROOT build setting.
I've seen similar errors to yours in a project with multiple targets. Make sure that your Podfile includes a link_with setting that specifies all your app targets.
If you have at least one test target, consider using your Podfile to explicitly import all your app pods to both your application and test targets.
I've not too much experience using a custom xcconfig with CocoaPods, but you might first try removing your xcconfig and allowing CocoaPods to generate its own first.
Close project
Do pod deintegrate
Delete - Podfile.lock, Pods,.xcworkspace in project directory
Do sudo gem install cocoapods
Do pod install
Go to project directory right click on
project.xcodeproj -> show package contents -> open project.pbxproj
Find
"Pods/Target Support Files/
and replace with
"Target Support Files/
This solution will work at any cost!
Try deleting the debug.xcconfig file and run pod install again. It solved my issue
In my case, I deleted my Podfile, Podfile.lock.
Run pod init, then copy all pods to new Podfile, then run pod install again and it's worked.
I think it's happened for the differences from folder paths in the old project (for me, I cloned another project from Git repo).
For me, changing Build system to Legacy in File -> workspace settings did the trick
For me, this caused after I updated cocoapods. So, I downgraded and the build worked again.
To downgrade, first list of all your versions:
sudo gem list cocoapods
Then specify the you want to delete (for me was 1.8.4):
sudo gem uninstall cocoapods -v 1.8.4
Then, with 1.5.3 worked!
This is what worked for me !
I use always Bundler to manage ruby dependencies, then in all my iOS projects i have Gemfile that look like this !
source "https://rubygems.org"
gem "cocoapods"
gem "fastlane"
gem "jazzy"
gem 'xcodeproj', :git => 'https://github.com/CocoaPods/Xcodeproj.git'
gem 'fastlane-plugin-teams', :git => "https://github.com/mbogh/fastlane-plugin-teams"
plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile')
eval_gemfile(plugins_path) if File.exist?(plugins_path)
i just run the following, i advice you using alias for this :
## Alias to add in zshrc or bashrc
# bundle install
bdli() {
bundle install $#;
}
piu() {
kill $(ps aux | grep 'Xcode' | awk '{print $2}');
pod deintegrate;
pod repo update;
pod install;
pod update;
open -a Xcode *.xcworkspace;
}
then simply run :
bdli && piu
It will do everything for you :)
PS : To install Bundler go here -> Bundler
pod reintegrate
pod install
edit the .xcodeproj/project.pbxproj file and change the PBXGroup "path = Pods" to "name = Pods"

How to update a single pod without touching other dependencies

I understand that the following command will update a single pod: pod update <podname>. However this also updates the dependencies of other pods (pods that were not included in the update command) that you have previously installed. Is there a way to update a single pod and leave all other dependencies alone?
Make sure you have the latest version of CocoaPods installed.
$ pod update PODNAME was introduced recently.
See this issue thread for more information:
$ pod update
When you run pod update SomePodName, CocoaPods will try to find an updated version of the pod SomePodName, without taking into account the version listed in Podfile.lock. It will update the pod to the latest version possible (as long as it matches the version restrictions in your Podfile).
If you run pod update without any pod name, CocoaPods will update every pod listed in your Podfile to the latest version possible.
To install a single pod without updating existing ones-> Add that pod to your Podfile and use:
pod install --no-repo-update
To remove/update a specific pod use:
pod update POD_NAME
Tested!
It's 2015
So because pod update SomePod touches everything in the latest versions of cocoapods, I found a workaround.
Follow the next steps:
Remove SomePod from the Podfile
Run pod install
pods will now remove SomePod from our project and from the Podfile.lock file.
Put back SomePod into the Podfile
Run pod install again
This time the latest version of our pod will be installed and saved in the Podfile.lock.
just saying:
pod install - for installing new pods,
pod update - for updating existing pods,
pod update podName - for updating only specific pod without touching other pods,
pod update podName versionNum - for updating / DOWNGRADING specific pod without touching other pods
You can never get 100% isolation. Because a pod may have some shared dependencies and if you attempt to update your single pod, then it would update the dependencies of other pods as well. If that is ok then:
tl;dr use:
pod update podName
Why? Read below.
pod update will NOT respect the podfile.lock. It will override it — pertaining to that single pod
pod install will respect the podfile.lock, but will try installing every pod mentioned in the podfile based on the versions its locked to (in the Podfile.lock).
This diagram helps better understand the differences:
The major problem comes from the ~> aka optimistic operator.
Using exact versions in the Podfile is not enough
Some might think that specifying exact versions of their pods in their Podfile, like pod 'A', '1.0.0', is enough to guarantee that every user will have the same version as other people on the team.
Then they might even use pod update, even when just adding a new pod, thinking it would never risk updating other pods because they are fixed to a specific version in the Podfile.
But in fact, that is not enough to guarantee that user1 and user2 in our above scenario will always get the exact same version of all their pods.
One typical example is if the pod A has a dependency on pod A2 — declared in A.podspec as dependency 'A2', '~> 3.0'. In such case, using pod 'A', '1.0.0' in your Podfile will indeed force user1 and user2 to both always use version 1.0.0 of the pod A, but:
user1 might end up with pod A2 in version 3.4 (because that was A2's latest version at that time)
while when user2 runs pod install when joining the project later, they might get pod A2 in version 3.5 (because the maintainer of A2 might have released a new version in the meantime).
That's why the only way to ensure every team member work with the same versions of all the pod on each's the computer is to use the Podfile.lock and properly use pod install vs. pod update.
The above excerpt was all derived from pod install vs. pod update
I also highly recommend watching what does a podfile.lock do
Just a small notice.
pod update POD_NAME
will work only if this pod was already installed. Otherwise you will have to update all of them with
pod update
command
I'm using cocoapods version 1.0.1 and using pod update name-of-pod works perfectly. No other pods are updated, just the specific one you enter.
This is a bit of an outlier and not likely to be what the OP was dealing with, but pod update <podname> will not work in all cases if you are using a local pod on your computer.
In this situation, the only thing that will trigger pod update to work is if there is a change in the podspec file. However, making a change will also allow for pod install to work as well.
In this situation, you can just modify something minor such as the description or summary by one letter, and then you can run the install or update command successfully.
pod update POD_NAME will update latest pod but not update Podfile.lock file.
So, you may update your Podfile with specific version of your pod e.g pod 'POD_NAME', '~> 2.9.0' and then use command pod install
Later, you can remove the specific version naming from your Podfile and can again use pod install. This will helps to keep Podfile.lock updated.

Resources