Cocoapods Completely Broke - ios

To start: I'm using Cocoapods 0.37.2, XCode 6.3.1 compiling for iOS 8.3
My project worked just fine before I ran a basic "pod update" now it's completely refusing to compile. I'm quite positive this has nothing to do with the pods themselves. Specifically the error I'm getting is this:
ld: warning: directory not found for option '-F/Users/user_name/Library/Developer/Xcode/DerivedData/AppName-bjozswzeepmhacfkeimeepxzcxgb/Build/Products/Debug-iphoneos/include'
ld: library not found for -lPods-AppName-AFNetworking
Podfile is this:
# Uncomment this line to define a global platform for your project
platform :ios, "8.0"
def shared_pods
pod 'SocketRocket'
pod 'AFNetworking'
pod 'DateTools'
pod 'Spotify-iOS-SDK'
end
target "AppName" do
shared_pods
end
target "AppNameTests" do
shared_pods
end
I have cleared DerivedData (many many times), cleaned my builds, restarted XCode, restarted my machine, I have ensured my config files and linker config lists are set up correctly. I've been using Cocoapods for years and never had this much trouble.
Completely frustrated and confused... questioning sanity.
Any help?

Information from CocoaPods troubleshooting doc. Hope this helps you.
If Xcode complains when linking, e.g. Library not found for -lPods, it
doesn't detect the implicit dependencies:
Go to Product > Edit Scheme
Click on Build
Add the Pods static
library, and make sure it's at the top of the list
Clean and build again
If that doesn't work, verify that the source for the spec you
are trying to include has been pulled from GitHub. Do this by looking
in /Pods/. If it
is empty (it should not be), verify that the
~/.cocoapods/master//.podspec has the correct git hub url
in it.
If still doesn't work, check your Xcode build locations
settings. Go to Preferences -> Locations -> Derived Data -> Advanced
and set build location to "Relative to Workspace".

Related

Cocoapods "Framework not found Pods_<my_project_name>"

I am trying to set up Cocoapods with my project for the first time, to use one framework that only comes as a pod. I already have an xcworkspace file, so I specified that in the Podfile. When I run pod install, it adds a reference to a framework Pods_<my_project_name>, but Xcode can't find that framework at build time. I can't find it on disk either. I see the framework for my one included pod framework in the Pods directory, but no Pods_<my_project>.framework.
If I delete the reference to the errant framework I can build, but it comes back if I run pod install again.
My issue is very similar to this reported issue, but I am definitely opening and building via my xcworkspace file.
When I first ran pod install it warned about some things, like including a reference to their xcconfig file in mine and setting $(inherited) in some settings I had values for - I fixed all those, and pod install no longer produces any warnings.
What is this framework supposed to be / do? Where is it supposed to live?
EDIT: Here's the Podfile:
platform :ios, '12.0'
workspace 'iOS'
target "MyProject" do
use_frameworks!
pod 'AdaptiveCards', '1.2.7'
end

'Multiple commands produce' error not resolving

I'm getting these errors when trying to archive my app for the App Store. During testing these never resent themselves. I found a similar post here but the solution doesn't work for me as I don't have the offending files in that build phase. I am using pods to install, so I don't know if that would make the solution different.
1) Target 'Realm-iOS11.0' has create directory command with output '/Users/user/Library/Developer/Xcode/DerivedData/.../IntermediateBuildFilesPath/UninstalledProducts/iphoneos/Realm.framework'
2) Target 'Realm-iOS12.2' has create directory command with output '/Users/user/Library/Developer/Xcode/DerivedData/.../IntermediateBuildFilesPath/UninstalledProducts/iphoneos/Realm.framework'
Second error
1) Target 'RealmSwift-iOS11.0' has create directory command with output '/Users/user/Library/Developer/Xcode/DerivedData/.../IntermediateBuildFilesPath/UninstalledProducts/iphoneos/RealmSwift.framework'
2) Target 'RealmSwift-iOS12.2' has create directory command with output '/Users/user/Library/Developer/Xcode/DerivedData/.../IntermediateBuildFilesPath/UninstalledProducts/iphoneos/RealmSwift.framework'
As I was typing this out I poked around some more and eventually figured it out. I tried to deintegrate and reinstall pods, but it failed because there are different targets of the project that were using different versions of Swift. After I matched all targets to the same version of Swift and installed, everything was fine.
Clear your Derived Data folder.
You can go to File > Workspace Settings if you are in a workspace environment or File > Project Settings for a regular project environment.
Then click over the little grey arrow under Derived data section and select your project folder to delete it.
Please specify a platform for this target in your Podfile. See https://guides.cocoapods.org/syntax/podfile.html#platform.
Example:
target 'theProject' do
platform :ios, '12.0'
use_frameworks!
# some pod
end
target 'theWidgetExtension' do
platform :ios, '12.0'
use_frameworks!
# some pod
end
You must using the same version of Pod library. Please read more in your terminal.

Can't archive react-native project in XCode for staging configuration with Pods

react-native: 0.50.3
xcode: 9.1 (9B55)
I have 3 configuration:
Default
Stage
Production
In 1 and 3 Product > Archive is working fine. When I try to archive Stage, I got an error:
ld: library not found for -lPods-carrier_mobile_app
This error appears after adding Pods in my project. Podfile looks like
platform :ios, '8.0'
target 'carrier_mobile_app' do
# Pods for carrier_mobile_app
pod 'RSKImageCropper'
pod 'QBImagePickerController'
end
I think I should configure Pods for Stage configuration correct. Any ideas?
Referring to this here: https://medium.com/#guyeldar/setting-up-multiple-build-configurations-for-your-xcode-project-c237265e8324
Theoretically adding $(BUILD_DIR)/Release$(EFFECTIVE_PLATFORM_NAME) to your Header, Framework, and Library search paths in your targets will work. However, it only worked one time for me, then I accidentally changed something, and it hasn't been working since. Worth a shot, though.

Xcode: Cannot parse the debug map for .. is a directory

I'm trying to link my iPhone simulator project and I'm getting the following error at link time:
(null): error: cannot parse the debug map for "/Users/admin/Library/Developer/Xcode/DerivedData/TrainTracks-agvvryrtufplkxecblncwedcelck/Build/Products/Debug-iphonesimulator/TrainTracks.app/TrainTracks": Is a directory
Here's the linker output:
GenerateDSYMFile /Users/admin/Library/Developer/Xcode/DerivedData/TrainTracks-agvvryrtufplkxecblncwedcelck/Build/Products/Debug-iphonesimulator/TrainTracks.app.dSYM /Users/admin/Library/Developer/Xcode/DerivedData/TrainTracks-agvvryrtufplkxecblncwedcelck/Build/Products/Debug-iphonesimulator/TrainTracks.app/TrainTracks
cd /Work/TrainTracks/TrainTracks
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/dsymutil /Users/admin/Library/Developer/Xcode/DerivedData/TrainTracks-agvvryrtufplkxecblncwedcelck/Build/Products/Debug-iphonesimulator/TrainTracks.app/TrainTracks -o /Users/admin/Library/Developer/Xcode/DerivedData/TrainTracks-agvvryrtufplkxecblncwedcelck/Build/Products/Debug-iphonesimulator/TrainTracks.app.dSYM
error: cannot parse the debug map for "/Users/admin/Library/Developer/Xcode/DerivedData/TrainTracks-agvvryrtufplkxecblncwedcelck/Build/Products/Debug-iphonesimulator/TrainTracks.app/TrainTracks": Is a directory
What would cause this problem?
I started off with a Game template (Xcode 7.2.1) and deleted the main story board and AppDelegate.* files since this is an SDL cross-platform project.
This problem was caused by a second inclusion of a TrainTracks folder in my project. I already had a yellow TrainTracks group with all of my source but for some reason Xcode was also showing a blue TrackTracks folder as well. This has a duplicate info.plist and other files. I removed the blue folder reference and the project now builds successfully.
If you are using CocoaPods, and you get this error after changing the name of your Target, click on your target, go to the General tab, scroll down to "Linked Frameworks and Libraries" and then delete the following library:
libPods-YourOldTargetName.a
For me this error was the inclusion of the same .m file twice in the project. Happened while moving some files around. Quit Xcode, clean and it told me the file in a linker error.
I ran into this problem trying to run my tests, and it was because my test target required the use of one of the pods I had in my Podfile. To fix it I just added my test target to the Podfile and included the relevant pods, as per the following pattern:
workspace 'myproject.xcworkspace'
platform :ios, '8.0'
use_frameworks!
def shared_pods
pod 'RealmSwift', '~> 2.8'
end
project 'myproject.xcodeproj'
target :MyProject do
project 'myproject.xcodeproj'
shared_pods
end
target :MyProjectTests do
project 'myproject.xcodeproj'
shared_pods
end
In my case, this same error showed up because one of the frameworks used in the app was compiled without Bitcode, so I had to turn off Bitcode for the entire project.
In my case, I had made a duplicate of one of my .m files in the finder to keep as reference, and somehow (most likely my error) it was added to the project explorer. The real error was duplicate definitions since the class appeared twice. Removing the "ClassNameHere_copy.m" fixed the issue.
For me, it was because I changed my target name which made a new cocoa pods .a library but didn't remove the other from linking.
In My case I had to delete my entire repository and clone again, nothing else worked, after fresh cloning, I ran a pod install and it worked.

Cocoapods Warning - CocoaPods did not set the base configuration of your project because because your project already has a custom config set

After I execute a pod install at the base of my project, I get the following error:
CocoaPods did not set the base configuration of your project because because your project already has a custom config set. In order for CocoaPods integration to work at all, please either set the base configurations of the target BluePlaquesLondonFramework to Pods/Target Support Files/Pods/Pods.debug.xcconfig or include the Pods/Target Support Files/Pods/Pods.debug.xcconfig in your build configuration.
This probably sounds like a silly question, but how do I set the base configuration for a target?
https://github.com/seanoshea/BluePlaquesLondon/blob/ios8/Podfile is the Podfile which is causing this issue.
http://github.com/seanoshea/BluePlaquesLondon on the iOS 8 branch is the Podfile in question if you're curious to see what the project looks like.
I had the same problem, but in Xcode 6.1.1 - what fixed it for me was to change the configuration file setting to None for the two Pods-related targets, then run pod install again.
The configuration file setting is found by selecting the project (not the target) and then the Info tab.
Don't tinker, Reset.
Step-by-step
Show Project Navigator
Select Project
Select Info
In Configurations, select each one, one at a time (Debug, ApplicationUnitTest, Release, etc.), and for each target within said configuration, set configuration to None.
Make certain that Based on Configuration File reads 0 Configurations Set or No Configurations Set for each configuration. That is the crux.
Quit Xcode
rm -rf Pods/ Podfile.lock ; pod install
Once you have allowed pod install in step 7 to do its magic, you may be able to use a custom config and change your configurations.
Go into XCode and open your project settings and under the Info tab, you will see "Configurations" where you can set a configuration file for both Debug and Release. You apparently have already set these to some custom config and CocoaPods wants/needs you to use the Pods config.
Ran into the same problem. It would build on the simulator but not on my device. None of the answers solved this for me. Here's what I did piecing some answers together:
Changed my pods file to use a specific target:
target :MyProject do
pod 'AWSCognitoSync'
pod 'Facebook-iOS-SDK'
end
Ran pod install
That gives an error:
[!] CocoaPods did not set the base configuration of your project because your project already has a custom config set. In order for CocoaPods integration to work at all, please either set the base configurations of the target `MyProject` to `Pods/Target Support Files/Pods-MyProject/Pods-MyProject.debug.xcconfig` or include the `Pods/Target Support Files/Pods-MyProject/Pods-MyProject.debug.xcconfig` in your build configuration.
Go Project settings and click on Info tab. There will be an error where it cannot find the Configuration file. Set it to "None" for Debug and Release.
Run pod install yet again
Clean and build. This works.
I fixed my issue after a careful reading of the error message:
[!] CocoaPods did not set the base configuration of your project
because your project already has a custom config set. In order for
CocoaPods integration to work at all, please either set the base
configurations of the target Runner to Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig or include the Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig in your build
configuration (Flutter/Release.xcconfig).
Solution
Open Xcode and change the Runner Info Base Configurations to the
related Pods-Runner.profile.xconfig.
Quit Xcode
Terminal: From the ios project folder run pod deintegrate
Verify pods are removed
Project has been deintegrated. No traces of CocoaPods left in project.
Note: The workspace referencing the Pods project still remains.
Terminal: From the ios project folder run pod install
(from this original - BAD)
(to this GOOD settings)
Notes
I have not been able to resolve the issue using the second
suggestion of including the xconfig file inside of the
Flutter/Release.xcconfig configuration file as mentioned in the
error message.
You should also make sure that you have no pods in the root of Podfile, you should define all the pods that are used in many targets like that:
def shared_pods
pod 'ReactiveCocoa', '~> 2.5'
end
target 'app' do
shared_pods
pod 'RestKit'
end
target 'tests' do
shared_pods
pod 'OCMock'
end
You also might need to delete libPods.a and libPods-app.a from the target dependencies, perform a clean and then run pod install again.
For those coming from the Flutter world, this is a misleading error message suggesting an unnecessary action, and the correct course is to ignore the error and use the flutter cli (not pod), as discussed in https://github.com/flutter/flutter/issues/73845:
gatzsche says a better message would be:
In Flutter pod install should not called manually. To run pod install
execute the following commands flutter clean, flutter pub get and
flutter build ios.
jmagman notes:
As you point out, the error message is suggesting an action that isn't necessary. The flutter command suppresses that message from pod. You ran pod directly, which isn't a recommended workflow. We don't have any control of error messages coming from CocoaPods, and the flutter command line tool already suppresses the confusing message.
I just ran into this issue after adding some custom build configurations. I could see under:
Pods (target) > Target Support Files > Pods
that it had actually created the new xcconfig files that matched the new build configurations but for some reason I could not select these in the project target of my app.
What fixed it for me was to install and use cocoapods-deintegrate:
gem install cocoapods-deintegrate
and then run:
pod deintegrate
followed by:
pod install
In case you are using custom config you can follow the suggestion in the warning and include the Pod config in your config file
#include "Pods/Target Support Files/Pods-YYY/Pods-YYYY.develop-archive.xcconfig"
This will NOT stop the warnings but will allow you to use your private config (there is an open bug on the warning with CocoaPods project)
https://github.com/CocoaPods/CocoaPods/issues/2633
If you added a custom build configuration to your existing project, Cocoapods will complain about it.
Cocoapods will automatically create xcconfig files under the directory Pods/Target Support Files/<build_target> following the naming pattern Pods-<build_target>.<build_config>.xcconfig.
Just make sure to manually add those files to your project in Xcode (under the Pods directory, but not inside the Pods project!). Once those files are included select your project in Xcode, go to the "Info" tab, and expand your custom configuration. Select the appropriate xcconfig file for each target under your custom configuration.
The line in the podfile that is generating a problem is : link_with ['BluePlaquesLondon', 'BluePlaquesLondonFramework'].
Just make this : link_with ['BluePlaquesLondon'] or this (worked in my case, hope it will in yours :-)) :
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
xcodeproj 'BluePlaquesLondon.xcodeproj'
inhibit_all_warnings!
link_with ['BluePlaquesLondon']
def import_pods
pod 'TTTAttributedLabel', '~> 1.10.1'
pod 'GoogleAnalytics-iOS-SDK', '~> 3.0.9'
pod 'Google-Maps-iOS-SDK'
pod 'IntentKit'
pod 'HCViews'
pod 'SVProgressHUD', :head
pod 'iRate'
pod 'iOS-KML-Framework', :git => 'https://github.com/FLCLjp/iOS-KML-Framework.git'
end
import_pods
target "BluePlaquesLondonFramework" do
import_pods
pod 'Kiwi'
end
I had the same error while pod install. I tried everything (reinstall pod, update all gems, etc.) and I found solution worked in my case. There was problem because of changing target's name. In this case solution is simple:
Click Product -> Scheme -> Manage Schemes...
Click on your target on the list and delete it with "-" sign on bottom of window.
Click "+" to add target back to list. Choose correct target and name.
After all everything should works.
I moved pods in Podfile outside from the target. File changes from this:
# Uncomment this line to define a global platform for your project
# platform :ios, '8.0'
# Uncomment this line if you're using Swift
use_frameworks!
target 'MyProject' do
pod 'Firebase', '>= 2.5.0'
pod 'Onboard'
pod 'GoogleMaps'
pod 'IQDropDownTextField'
end
To this:
# Uncomment this line to define a global platform for your project
# platform :ios, '8.0'
# Uncomment this line if you're using Swift
use_frameworks!
pod 'Firebase', '>= 2.5.0'
pod 'Onboard'
pod 'GoogleMaps'
pod 'IQDropDownTextField'
target 'MyProject' do
end
Add the relevent xcconfig files to your project. Cocoapods will have created them but you can't set them in Xcode until they are in the project.
You probably want to add them to the Pods group where the other pods xcconfig files are. Right click and add files.
Search for xcconfig files in your project folder or look in Pods/Target Support Files/[TARGET_NAME]/ (I have different cocoapods configured for each target (extension and main project this may be slightly different in your case)
Go to project configurations in the Info of your main project
For each target and configuration set the appropriate pods configuration.
pod install again and you should see no errors.
So for me, the problem was due to the aforementioned xcconfig files names being changed before the Swift 3 update took place.
Something was out of sync, so Cocoapods created a 'Recovered References' folder section with the old named files, and linked to them.
To fix this, I:
Removed the 'Recovered References' folder and the containing old
.xcconfig files from Xcode and file system
Quit Xcode
Run pod install
Everything was handled for me after then, and the warnings were gone.
I was able to build the project touched by this issue on XCode 6 by:
selecting Project from the Project Navigator
choosing Project instead of Target
going to Info tab
choosing Pods.(debug/release) Configuration Files from the combobox for the respective Configurations.
Hope this will help someone.
This happened to me because I already had a Pod configuration. I'm new on iOS development, was searching instructions to install Alamofire + SwiftyJSON and ended up installing the libraries more than once, inadvertently. To me, what worked was: on the folder "Target Support Files" in "Pods" project, I selected the two correct .xcconfig files and dragged them to the "Pods" folder of my app project. This enabled the selection of the correct config files on the base configuration.
But then, if I run "pod install" again, the warning will change to the previous .xcconfig file. I try to delete the files and the old framework from the main project but when i ran the previous command once more, gave me the same warning, and created the file "Pods.framework" under the "Pods" folder of my app project. I ignored it, and it seems to be running ok, despite the two frameworks. I don't know if it's right, and a solution, if exists, it would be welcomed.
I had 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.
I just checked the path where I was installing the pod and corrected it and installed again,It just worked.
Make sure give the path just before where .xcodeproj or .xcworkspace (if it is already there) exists.
Sorry my previous answer was unclear. This was just one of many errors i've got while trying to set up Cloud Firestore, so this answer is specific for that situation. In order to solve this error and make firebase work, eventually, you have to follow all of the steps from this page: https://firebase.flutter.dev/docs/firestore/overview/ . If you are having problems with generating the 'firebase_options.dart' file, then you need to follow the steps on this page: https://firebase.google.com/docs/cli#mac-linux-auto-script . The last step is optional, but it reduces build time, and I really don't know how or why, but it made some of other errors also disappear... Step 4. Improve iOS & macOS build times, from this page https://firebase.flutter.dev/docs/firestore/overview/. And off course, don't forget to add dependencies in pubspec.yaml: https://pub.dev/packages/firebase_core/install . There is also a great comment here about using Firebase.initializeApp() : https://stackoverflow.com/a/63492262/17626190
Seems a good ole system restart and probably more importantly it seems I had to reinstall cocoa pods even though the CLI seemed to be in perfectly working condition and had been working for many days before today.
Reinstalled CocoaPods 🤷
sudo gem install cocoapods
It doesn't seem this was the fix for anyone else, but I figured I should post it since this was driving me nuts, and hopefully it helps at least one other person.
This is the messages I got after running pod install or pod update:
[!] CocoaPods did not set the base configuration of your project because your project already has a custom config set. In order for CocoaPods integration to work at all, please either set the base configurations of the target `Runner` to `Target Support Files/Pods-Runner/Pods-Runner.debug-staging.xcconfig` or include the `Target Support Files/Pods-Runner/Pods-Runner.debug-staging.xcconfig` in your build configuration (`Flutter/Debug.xcconfig`).
[!] CocoaPods did not set the base configuration of your project because your project already has a custom config set. In order for CocoaPods integration to work at all, please either set the base configurations of the target `Runner` to `Target Support Files/Pods-Runner/Pods-Runner.release-staging.xcconfig` or include the `Target Support Files/Pods-Runner/Pods-Runner.release-staging.xcconfig` in your build configuration (`Flutter/Release.xcconfig`).
[!] CocoaPods did not set the base configuration of your project because your project already has a custom config set. In order for CocoaPods integration to work at all, please either set the base configurations of the target `Runner` to `Target Support Files/Pods-Runner/Pods-Runner.profile-staging.xcconfig` or include the `Target Support Files/Pods-Runner/Pods-Runner.profile-staging.xcconfig` in your build configuration (`Flutter/Release.xcconfig`).
This is what I did to solve the issue:
Add Schemes to Podfile under project 'Runner'
project 'Runner', {
'Debug' => :debug,
'Debug-staging' => :debug,
'Profile' => :release,
'Profile-staging' => :release,
'Release' => :release,
'Release-staging' => :release,
}
Go to ios/Flutter/Debug.xcconfig and include
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug-staging.xcconfig"
Go to ios/Flutter/Release.xcconfig and include
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release-staging.xcconfig"
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.profile-staging.xcconfig"
flutter clean
Delete podfile.lock
Pub get
pod install
Just follow the Android Studio instructions.
This is the error output:
"[!] CocoaPods did not set the base configuration of your project because your project already has a custom config set. In order for CocoaPods integration to work at all, please either set the base configurations of the target `Runner` to `Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig` or include the `Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig` in your build configuration (`Flutter/Release.xcconfig`)."
In android studio IDE go to IOS folder/Flutter and open the file Release.xconfig
Then just past this line:
Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig
Delete podfile.lock and try to rebuild in Xcode. Worked for me.
The simplest solution for this (after having this issue multiple times):
Delete Podfile & Podfile.lock from your project library (save Podfile somewhere so you could easily paste to new Podfile)
run 'pod init'
Edit the 'Podfile' to your will (add pods you are using)
run 'pod install'
This would recreate everything and works always in minutes (not spending time to reverse engineer the "bug").

Resources