I want to use MapBox Search SDK for iOS. So I've followed this official documentation
Firstly, I've created ".netrc" in my /home directory as instruction and then add this -
use_frameworks!
target "TargetNameForYourApp" do
pod 'MapboxSearchUI', ">= 1.0.0-beta.3", "< 2.0"
end
to podfile. Then run pod install and got this in terminal -
Analyzing dependencies
Downloading dependencies
Installing MapboxCommon (9.0.2)
Installing MapboxMobileEvents (0.10.8)
Installing MapboxSearch (1.0.0-beta.4)
Installing MapboxSearchUI (1.0.0-beta.4)
Generating Pods project
Integrating client project
[!] Please close any current Xcode sessions and use `MapBox.xcworkspace` for this project from now on.
Sending stats
Pod installation complete! There is 1 dependency from the Podfile and 4 total pods installed.
[!] Automatically assigning platform `ios` with version `12.1` on target `MapBox` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.
But after running all this I'm getting this error in Xcode -
Framework not found MapboxCommon.xcframework
I've also tried this -
pod deintegrate && pod cache clean --all
pod install
but still the same error.
I think I've followed correctly the documentation and entered the secret API Key correctly. So why am I getting this error?
Edit:
In Project Targets the installed pods are not listed -
But In pod folder in Project directory -
there are other frameworks available which are not available in Xcode Pods Target.
Is that the pointing that the frameworks are not available in the projects?
Edit:
I've checked in my project directory if the Mapbox.common.xcfreamework present or not. And I found that file under pod/mapboxCommon folder
I've been opening my project using MapBox.xcworkspace which file was generated after running pod install.
You are facing this error because you are still trying to build the project file (xcodeproj), not the generated workspace by CocoaPods.
To resolve this issue, open up 'MapBox.xcworkspace' file and use that file to access your projects from now on.
I am facing an error while making a flutter plugin on the iOS side while using pods. The pods are installed successfully then also I am able to import them in the file.
The pod in my case which I am trying to use is Freshchat iOS SDK
Steps I have followed to install the pod
Start a new Flutter plugin project.
In .podspec file add s.dependency 'FreshchatSDK'
Run pod install in example/ios folder.
I got an error
The 'Pods-Runner' target has transitive dependencies that include statically linked binaries: (/Users/nimish/FlutterProjects/freshchat_flutter/freshchat_flutter/example/ios/Pods/FreshchatSDK/FreshchatSDK/libFDFreshchatSDK.a)
I removed use_frameworks! from podfile following this comment .
I ran pod install again and the pods were successfully installed and Pods folder was created which had FreshchatSDK folder in it.
Now I need to have use_frameworks! in my project because other plugins are not compiling because of this.
I added s.static_framework = true in .podspec and use_frameworks! in podfile. Now pod install ran successfully,
After I added the import #import "FreshchatSDK.h" in my Plugin.h file I got the error
error: include of non-modular header inside framework module
I tried this answer but was not able to resolve it.
Please help me resolve this. I'll be respectful of your time.
There is another flutter plugin available here but it has many issues and one unhandled case is making my iOS app crash so I want to make it my own.
There may be problems in the PodFile due to unmatched Targets.
When this happens to me, I used these simple steps.
Delete Podfile
Open Terminal at the specific file
Pod init
Open Podfile and adds Dependencies
Pod install
hi Iam new to iOS and i am trying to use CVCalender for custom calendar https://github.com/CVCalendar/CVCalendar#-cocoapods-
and i am try to install the cocoa pods but its getting error,
But i have muly cocopods in my file is these are use full or i need to delete these things as shown in image
can any one help me to how to install coacoa pods sucessfully and install cvcalender
after adding delegates also showing same error
1.Open terminal
sudo gem install cocoapods
2.Setup the cocoapods master repo
pod setup
download the master repo. The size is big approx 370.0MB
3.Create xcode project and select root directory in terminal.
cd "your XCode project root directory"
4.Then type
pod init
5.Then open your project's podfile by typing in terminal
open -a Xcode Podfile
6.Add your project's dependencies in open text podfile.
**for ex.** pod 'CVCalendar', '~> 1.5.2'
7.Then install pods into your project by typing in terminal
pod install
Now close your xcode project and open .xcworkspace xcode project file.
Happy Coding.
Also refer cocoapods link. https://cocoapods.org/
I've encountered an strange issue after installing RestKit with cocoapods.
after resolving RestKit dependency for my project with cocoapods and trying to build it, I face this error:
The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.
I tried running pod install, but no change.
Here are some shots:
PODS:
- AFNetworking (1.3.3)
- RestKit (0.20.3):
- RestKit/Core
- RestKit/Core (0.20.3):
- RestKit/CoreData
- RestKit/Network
- RestKit/ObjectMapping
- RestKit/CoreData (0.20.3)
- RestKit/Network (0.20.3):
- AFNetworking (~> 1.3.0)
- RestKit/ObjectMapping
- RestKit/Support
- SOCKit
- RestKit/ObjectMapping (0.20.3)
- RestKit/Search (0.20.3):
- RestKit/CoreData
- RestKit/Support (0.20.3):
- TransitionKit (= 1.1.1)
- RestKit/Testing (0.20.3)
- SOCKit (1.1)
- TransitionKit (1.1.1)
DEPENDENCIES:
- RestKit (~> 0.20.0)
- RestKit/Search (~> 0.20.0)
- RestKit/Testing (~> 0.20.0)
SPEC CHECKSUMS:
AFNetworking: 61fdd49e2ffe6380378df37b3b6e70630bb9dd66
RestKit: 1f181c180105a92f11ec4f6cd7de37625e516d83
SOCKit: 2f3bc4d07910de12dcc202815e07db68a3802581
TransitionKit: d0e3344aac92991395d4c2e72d9c5a8ceeb12910
COCOAPODS: 0.29.0
I was able to fix that by updating CocoaPods.
I. Project Cleanup
In the project navigator, select your project
Select your target
Remove all libPods*.a in Build Phases > Link Binary With Libraries
II. Update CocoaPods
Launch Terminal and go to your project directory.
Update CocoaPods using the command pod install
After many attemps I managed to fix this problem. Variable ${PODS_ROOT} was not set and I do below trick.
Go to Build Phases -> Check Pods Manifest.lock and replace
diff "${PODS_ROOT}/../Podfile.lock" "${PODS_ROOT}/Manifest.lock" > /dev/null
to
diff "${SRCROOT}/Podfile.lock" "${SRCROOT}/Pods/Manifest.lock" > /dev/null
It helps me.
I had been searching for hours and I found solutions as follow:
In my case, method 1 works.
Method 1:
choose the target > go to Build Phases > click Link Binary With Libraries > remove all libPods.a files
open Terminal > direct to your project > run:
pod install
clean and build project
ref.1
Method 2:
open Terminal > direct to your project > run:
pod deintegrate --verbose
pod install --verbose
ref.2
Method 3:
choose the target > go to Build Settings > click "+" sign
add 2 User-Defined Settings: [to the left = to the right]
PODS_ROOT = ${SRCROOT}/Pods
and
PODS_PODFILE_DIR_PATH = ${SRCROOT}/
ref.3
If you remove all pods from your target in the Podfile, e.g.
target 'myTarget' do
pod 'great-stuff', '~> 4.0' // you deleted this last pod
end
you'll need to manually delete these builds steps from your Xcode target Build Phases:
Check Pods Manifest.lock
Copy Pod resources
Cocoapods (current stable version 0.37.2) does not perform this cleanup when you run pod install.
Removing pods from the project and re-installing worked for me.
There is nice GitHub repository that can completely remove the pods from the project.
Just keep the backup of your PodFile and run below commands.
gem install cocoapods-deintegrate
gem install cocoapods-clean
Go to the project directory and run pod deintegrate
Again run pod clean
Run pod install
Clean and run.
If you are seeing an error like the following:
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.
Then 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
After changing target name
My problem was xcconfig with old target names.
Went to project file -> info -> configuration
Removed old xcconfig (both Debug & Release)
pod install
It would update to new ones.
Also if you had missing .h files that's the reason (pods header search path is in these xcconfig)
I found my solution: Run:pod update instead of pod install. The error was fixed!
Go to Build Phases -> Check Pods Manifest.lock
Replace
${PODS_ROOT}/Manifest.lock
with:
${SRCROOT}/Podfile.lock" "${SRCROOT}/Pods/Manifest.lock
Check in image :
First you have to understand what the Podfile.lock is then understand what the Manifest.lock is and where it's used.
The Podfile holds either the (optimistic or exact) versions of every dependency you have. The lock file holds only exact versions.
Once you do pod install all the pods get downloaded/installed into the /pods directory. You may want to commit them Or maybe not. That's up to your team. What's NOT up to your team is decide if they should commit the the Podfile.lock or not. That needs to be committed so every dev in the team can be sure they've got the exact same version.
So let's say you downloaded your team’s code. In your project's root directory you only have Podfile and Podfile.lock and the Pods directory wasn’t committed.
Then you do pod install to creat the Pods directory. Your snapshot of every pods’ version should match with the versions of all pods from the Podfile.lock.
CocoaPods has a safety check in place, to ensure matching versions
This is where the Manifest.lock comes into play. Manifest.lock is your local machine's lock created. It has to match with Podfile.lock that is generated by the last commit (that caused changes in for your pods) in your repo. If it doesn't match then something is messed up.
Docs on what the Manifest.lock file is:
# Manifest.lock: A file contained in the Pods folder that keeps track of
# the pods installed in the local machine. This files is used once the
# exact versions of the Pods has been computed to detect if that version
# is already installed. This file is not intended to be kept under source
# control and is a copy of the Podfile.lock.
I honestly can only think of one scenario in which the Manifest.lock and Podfile.lock would be out of sync:
I mean if you pull from main branch, then you get main's Podfile and lock file. If you then make a change to the Podfile and then run pod install, then you would be updating the Podfile.lock and Manifest.lock and will keep them in sync. No issues with this
Is this just so that if:
You and your team don’t commit the /Pods directory
You have merge conflicts in your Podfile or Podfile.lock but don’t realize it. Or you haven't committed both Podfile and Podfile.lock
Then given that Xcode doesn’t process the Podfile and Podfile.lock, then naturally your project can build successfully.
However if you go in an inspect your Build Phases of your targets you'd see the following
That script is documented here
# Adds a shell script build phase responsible for checking if the Pods
# locked in the Pods/Manifest.lock file are in sync with the Pods defined
# in the Podfile.lock.
#
# #note The build phase is appended to the front because to fail fast.
#
# #return [void]
What those lines do are: perform a diff and ensure that sure your Manifest.lock i.e. your local snapshot of all installed pod versions are equal to Podfile.lock i.e. your repo's current snapshot of all installed pod versions.
The fix is likely super simple, just make sure you Podfile is what you want. Then just run pod install. You have also somehow accidentally made changes to your Manifest.lock inside your /Pods directory (or as mentioned earlier maybe only committed the lock file but not the Podfile or vice versa). Deleting /Pods directory causes no harm. Just do a pod install after. Do not do pod update unless that's what you want.
Just make sure you never delete the Podfile.lock otherwise if you do pod install then it would update all dependencies to the latest version it can.
Also helpful to see and this video on lock files, CocoaPods docs on how the lock file is put to use differently for pod install vs. pod update and last see how all that logic is used in more detail
this artsy blog on checksums. It's worth noting that a single space will create a new checksum and can make things out of sync.
In my case, I got same error after integrating WatchKit app. To solve problem I needed to add both targets of WatchKit in Podfile:
target 'MyProject WatchKit App' do
platform :watchos, '2.0'
shared_pods
end
target 'MyProject WatchKit App Extension' do
platform :watchos, '2.0'
shared_pods
end
PS: Maybe this happened for me because I mistakenly installed pods for MyProject WatchKit App target initially.
Try to set up the correct target in Podfile and then run pod update or pod install
Can you try this:
Delete the Pods folder
Delete Podfile.lock
Run pod install
Clean + Build
Run this, and your errors will vanish
rm -rf Pods && gem install cocoapods && pod install
I encountered this issue with a misconfigured xcconfig file.
The Pods-generated xcconfig was not correctly #included in the customise xcconfig that I was using. This caused $PODS_ROOT to not be set resulting in the failure of diff "/../Podfile.lock" "/Manifest.lock", for obvious reasons, which Pods misinterprets as a sync issue.
For me the problem was that I made a new target in my app by duplicating an existing one, but forgot to add the target to the Podfile. For some reason, the cloned target did work for days without problems, but after a while it failed to build by this error. I had to create a new target entry for my cloned project target in the Podfile then run pod install.
If you download the project from github or copy from other place, then the dependencies library do not exists, there will be this issue.
You just need to cd to the project/project_name directory in terminal , use ls to check whether there is a Podfile file.
if there exists the Podfile, you just need to install the dependencyies:
pod install
My working answer is:
Install update your cocoapods by this command:
pod update
Install your new pods by this command.
pod install
Last one command:
sudo gem install cocoapods.
The steps that worked for me (XCode 8.3.3/XCode 9 beta with a Swift 3.1 project)
- Navigate to your project directory
- pod install //which then asks you to do the next step
- pod repo update //takes a while to update the repo
- pod update
- pod install
- Close Xcode session
- Open and Clean the project
- Build/Run
Also make sure you open the .xcworkspace file rather than the project file (.xcodeproj) when working with pods. That should solve any errors with linking such as "Apple Mach -O Linker command failed"
Please do the following steps:
1: Deleting the Podfile.lock file in your project folder
2: Deleting the Pods folder in your project folder
3: Execute 'pod install' in your project folder
4: Do a "Clean" in Xcode
5: Rebuild your project
I tried everything, but the problem persisted.
After that I did this and it worked ASAP (As Smooth As Possible).
Open the .xcworkspace file.
Change to legacy build system if using Cordova on Xcode 10.
Go to target/project of Podfile. Select Deployment traget as 11+
Then Change the debug and release to Pods-.build/release. It was App.debug/release in my case.Pic attached. Hope it helps.
Completely nothing worked out for me from these answers. Had to create the project again by running cordova platform add ios. What I've noticed, even freshly generated project with (in my case) Firebase pods caused the error message over and over again. In my opinion looks like a bug for some (Firebase, RestKit) pods in Xcode or CocoaPods. To have the pods included I could simply edit my config.xml and run cordova platform add iOS, which did everything for me automatically. Not sure if it will work in all scenarios though.
Edit: I had a Podfile from previous iOS/Xcode, but the newest as of today have # DO NOT MODIFY -- auto-generated by Apache Cordova in the Podfile. This turned on a light in my head to try the approach. Looks a bit trivial, but works and my Firebase features worked out.
This made my day!
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
Check Pods target and Runner target thats have to be same
1- Runner
2- Pods
Remove Pods.framework in:
Folder named Pods
Linked Frameworks and Libraries
And delete all new inputed lines from #main file App for ios
When you do
pod install --verbose
make sure:
1- you are in the correct directory. Most times, when a github project is downloaded, there will be a master folder. You need to be inside the actual project name folder(masterfolder/project folder) in the terminal before you invoke pod install --verbose
2- Delete the old pod lock folder then clean the project using xcode clean & do pod install.
3- Keep your rvm updated.
My problem was the cocoa pods version so I installed the latest with:
sudo gem install cocoapods --pre
Then pod update
That worked for me
If you are applying to the way Project Cleanup and your project still error.
You can go to tab Build Phases and then Find Check Pods Manifest.lock and remove the script.
Then type command to remove folder Pods like that rm -rf Pods
and then you need to remove Podfile.lock by command rm Podfile.lock
Probably, base on a situation you can remove file your_project_name.xcworkspace
Finally, you need the command to install Pod pod install --repo-update.
Hopefully, this solution comes up with you. Happy coding :)
I had same error. First I update cocoapods using
sudo gem install cocoapods
then install pods using Pod install command worked for me.
For me, working in flutter, the configuration was not automatically added due the existing configuration.
Adding #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig" to Flutter/Release.xcconfig and Flutter/Debug.xcconfig
solved the issue.
I'm doing the Ray Wenderlich tutorial called SimpleWeather.
The podfile is in the same folder as the project.
Here's my code from the podfile:
platform :ios, '7.0'
xcodeproj 'SimpleWeather'
pod 'Mantle'
pod 'LBBlurredImage'
pod 'TSMessages'
pod 'ReactiveCocoa'
The error message is this: [!] Unable to find the Xcode project /Users/myName/Developer/SimpleWeather.xcodeproj for the target Pods.
The name of the project is SimpleWeather.
I'm pretty sure you are not in the right directory. Are you sure your .xcodeproj is in the Developer folder? There might be a subfolder you need to navigate to.
The right way to enable CocoaPods in your Project is:
Open Terminal and execute: $ sudo gem install cocoapods
Navigate to your Project folder (I assume in your case it's cd /Users/myName/Developer/SimpleWeather/SimpleWeather.xcodeproj).
Setup Cocoapod pod setup
Create the Podfile touch Podfile
Open the Podfile open -e Podfile and insert your code for Podfile
Finally install the Podfile pod install
If you follow this instructions everything should work. When opening your project make sure to open the .xworkspacefile.
For more information, see this.
This error also occurs when you have multiple .xcodeproj in your Xcode project.
You don't need more than one .xcodeproj in general cases. Remove unnecessary .xcodeproj, and Cocoapods should get the correct path automatically afterwards.
Reiterating our original conversation:
Accordingly to Podfile Syntax Reference the Podfile looks right.
Make sure you are running $pod install from your project directory:
/Users/myName/Developer/SimpleWeather
Hey your path for the project might be wrong. Go to the project and right click on SimpleWeather.xcodeproj and select Get Info as show in the image below(The right side window is for Get Info here). Copy this path from the details window and paste it into the Podfile. After that append /SimpleWeather.xcodeproj to that pasted path. This might solve the problem(Note: It is a snap shot for my project). In your case the solution might be replacing the path with this /Users/myName/Developer/SimpleWeather/SimpleWeather.xcodeproj
To solve this issue, just follow below steps and your issue will get resolved :
Step 1 : Open Terminal and navigate to your project folder
Step 2 : touch podfile
Step 3 : open -e Podfile
Step 4 : Write below line in your text edit and close it
workspace '/Users/systemName/Developer/yourprojectname/yourprojectname.xcworkspace'
Step 5 : Pod install
And after successful process, you will not get this error again.
CheersKP
Maybe you have two project .xcodeproj, remove one.
Remove Podfile.lock, folder Pods. On Terminal cd /Users/myName/Developer/SimpleWeather and pod install
For people who are on Mac and also using code editors, the duplicate file that is causing this issue is ._projectname.xcodeproj because it has the same extension as the regular .xcodeproj files.
I had the same problem.
Then with many attempts of trials and errors I finally got the working solution:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
use_frameworks!
target 'SimpleWeather'
pod 'Alamofire', '~> 3.4'
This works when you are in your project directory (I assume you should navigate using terminal to /Users/myName/Developer/SimpleWeather/)
You installed your Xcode..in application use this command to execute
sudo xcode-select -switch /Applications/Xcode.app
so okay i had tried every possible thing ...i had only one .xcodeproj file
but sill i couldnt install so finally i had tried with the following
1. open terminal cd to your project folder one with .xcodeproj
2. type pod init
3. type touch Podfile
4. type pod install
Magic happens and your pod files gets installed
Check your Podfile for the following lines
config = use_native_modules!
use_react_native!(:path => config["reactNativePath"])
under
target '<project_name>' do
Hopefully this answer can be useful in times of many people using SPM. My case was the following: I had a binary framework package that had to be converted to the cocoapod, together with it's dependency tree. In the git repository where the package lived, the .gitignore file contained this line: /*.xcodeproj. This meant that even though everything worked fine locally, whenever the CI tried to run pod install it failed.