Couldn't build Objective-C module 'Firebase' - objective-c

Can someone help me out with this?
When I compile the application I get an error equal to this: Could not build Objective-C module 'Firebase'
Please take a look https://imgur.com/a/enbAN25
I tried to use this method and it did not work
1. Quit Xcode.
2. Delete project's temp files located at ~/Library/Developer/Xcode/DerivedData
3. Delete ProjectName.xcworkspace
4. Delete Podfile.lock file and Pods folder
5. Run pod install.
6. Open the newly created ProjectName.xcworkspace file and build.

This problem appeared after upgrading to Xcode 12.
Apparently removing the build configuration for valid architectures (VALID_ARCHS) fixes the problem. See Xcode 12 release notes.
To fix, just set:
Build Settings / TARGET / Architectures / Build Active Architecture
Only / Yes
I hope to help other people not to waste time with this

Related

Linker command failed with exit code 1 - duplicate symbol __TMRbBp

Since I've updated to Xcode 8.1 I can't archive and also not run in Release mode (in debug mode its working). The error is that there are several "duplicate symbols for architecture arm64" and all are "duplicate symbol __TMRbBp". Whats that?
It seems to be a bug in Swift. See
discussion on Apple developers portal
It is said to be fixed in Xcode version that is about to be released.
But for now there is temporary workaround:
Go to your target Build Settings and set Reflection Metadata Level flag to None
Don't double click Project.xcodeproj to start your xcode project. Instead, close your project and open the xcworkspace.
File -> Close Workspace
File -> Open -> Search your project folder for Project.xcworkspace
All my errors are gone.
I faced the same problem with archiving on Xcode 8.1.
X Code Version: Version 8.2.1 (8C1002)
The following fix worked on Mar 2019
1) Go to Project & Select your Project
2) Select Build Settings -
Search for "Enable Bitcode" Set option as "NO"
3) Most of version will fix this issue, for few other XCode version try this option also,
Search for "Reflection Metadata Level" Set option as "NONE"
I had similar issues with Version 9.2 (9C40b), the solution is
0) Close Xcode
1) Open project folder in terminal
2) pod update
3) open .
4) open project by clicking Project.xcworkspace
Surprisingly, in some occasions, simply cleaning the product worked for me.
Product/Clean (Shift+Cmd+K)
Product/Clean Build Folder (Alt+Shift+Cmd+K)
Quick fix to try before looking at other solutions.
1.Close your project:Completely quit Xcode.
2.Go to your project location:there you will find two files in you root folder with varying extensions:
Appname.xcodeproj and Appname.xcworkspace
Now open your project by Double clicking on file with the extensions xcworkspace.(***Appname.xcworkspace*)**
Yourproject will open in xcode.
Now run your project again.
If you pay close attention when installing your pods,firebase makes it clear to open your project with your-project.xcworkspace after installing pods
firebaseIOS Setup
$ cd your-project directory
$ pod init
Add to Podfile
pod 'Firebase/Core'
And finally:
$ pod install
$ open your-project.xcworkspace
Dont forget to add firebase to your AppDelegate
If you're using Ionic and the Push and Console plugins that's the problem. Remove the cordova console plugin (which is deprecated) and the error will disappear.
The linker error is saying that a library is duplicated which is, in fact, true because the console plugin is already in cordova-ios 4.5+
It took me a couple of hours to figure this out!
In my case
Select your project (In my case i have 2 targets)
Go to Build Phases
Compile Sources
Check if the number of items on each targets is the same (mine was different)
Add the missing file / Remove the duplicated file
Problem Solved
I ran into this problem recently creating a new project and adding some pods (AlamoFire specifically) to the project. Troubled with it a couple hours or so recreating the project (it was new) several times. Tried all the methods here and no luck.
Eventually I figured out that it was because XCode V10.1 was also opening the old project file along with the new pod-created workspace when I opened the workspace via command line "open myProject.xcworkspace" when I reopened the project after doing "pod install"
Closing all projects before exiting XCode before I did my "pod install" fixed everything for me.
close you project then open xcode go to file -> open search your project and open it . this worked for me
I got this error due to deletion of some files. For me simply cloning my project worked.
For those that can't get the Thorax's answer to work, what I did was I closed out Xcode, ran pod update on my command line and then reopened the .xcworkspace file. After doing that, I was able to build and run the project.
I am using the Firebase Cocoapod and Xcode version 9.1.
I had removed files from Compile Sources in Build Phases in Targets. I added main.m and it worked.
Had the same problem in Xcode 10.1 and was able to resolve it. In path Project Target > Build Setting > No Common Blocks, I changed it to No.
I had similar kind of problem when I added a framework to my project.
I have resolved the issue by removing the framework and again adding the framework to the project by dragging and dropping the framework file to the projects frameworks folder and selecting the Copy items if needed option.

Apple LLVM 5.0 error

I have this error while building new project:
fatal error: file '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIDevice.h' has been modified since the precompiled header '/Users/ajsthelords/Library/Developer/Xcode/DerivedData/ModuleCache/1X5NZJEZL1PED/UIKit.pcm' was built
note: after modifying system headers, please delete the module cache at '/Users/ajsthelords/Library/Developer/Xcode/DerivedData/ModuleCache/1X5NZJEZL1PED'
Your module cache is outdated as your SDK has changed since it was last built. To ask Xcode to rebuild it, you have to delete the directory, as indicated in the error message.
rm -rf '/Users/ajsthelords/Library/Developer/Xcode/DerivedData/ModuleCache/1X5NZJEZL1PED'
Remove derived data
Clean the app & reset simulator
restart Xcode if necessary

Xcode custom shell scripts are slowing down the compiling time

Testing any changes to my Xcode project has become an exercise in patience whenever I build. After all the source files have compiled, I get the following message in the activity window at the top of Xcode:
"Running 3 of 3 Custom Shell Scripts"
I have not added any of my own custom shell scripts but I am using quite a few dependencies via Cocoapods and I am using 2 frameworks for the build environment, Crashlytics and Tapstream. Crashlytics requires you add a run script in the build phases, other than that I don't know where the other ones are coming from and they appear to be the bottleneck in my build time.
Can anyone enlighten me as to what is going on and how i possibly speed it up?
I can't enlighten you but I can tell you how I stopped mine from running. This also happened after installing Cocoapods. In my main project's Target, under Build Phases, I noticed two entries entitled Check Pods Manifest.lock and another called Copy Pods Resources.
Under both there was an unchecked option Run script only when installing. I checked both and at least for now my projects build and run fine without running the scripts.
This is kind of a crappy answer because I can't really give you any more information, and it might not even work for your case, so hopefully someone comes along and enlightens us.
POSSIBLE EXTERNAL BUNDLE ISSUES
So I just had a frustrating experience debugging an issue where a pod installed library's NSLocalized strings file weren't working. Turns out it was because I checked the option mentioned above. Pods-resources.sh, which had the lines to install the bundle, wasn't running in debug mode. It was only running when installing - of course! Something to watch out for.
More info in this question:
NSLocalizedStringFromTable not working in CocoaPod dependency
To fix the slow "Copy pods resources" problem I figured out a solution to only copy the resources if they haven't been copied before.
For this purpose we have to patch the *-resources.sh files that are created by cocoapods such that the copy procedure only happens if a generated file in the target directory doesn't exist (it is created upon first copy). As long as this target directory exists and includes this autogenerated file, the copy resources phase is skipped. This saves me about 30 seconds in my project (of course depends on your project size). To accomplish this do the following:
Create a patch file called 'copy_pod_resources_once.patch' in your project root dir with the following contents:
5a6,13
> NONCE_FILE="${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/copyresources-done.nonce"
> if [ -f "$NONCE_FILE" ]; then
> echo "already copied resources"
> exit 0
> else
> touch "$NONCE_FILE"
> fi
>
In the Podfile for your project add the following post install hook:
post_install do |installer_representation|
system('find "./Pods/Target Support Files" -name "*-resources.sh" | xargs -I{} patch -p0 {} -i ./copy_pod_resources_once.patch')
<other post install stuff>
end
For me, it was Crashlytics. There were some outstanding changes, as Crashlytics does auto-updating of its files. I reset/removed them and rebuilt and got past it.
So the general answer may be to check any third party components and make sure they're working properly.
As Ramsel has said in this answer,
https://stackoverflow.com/a/21318086/1752988
I also went to Build Phases and cleared out all the possible links to PODs, after trying most of the other solutions and the three build issues shown regarding Pods were cleared out.
But then one file which was not list under the XCode Project navigator was missing, but they were in the Downloaded Git Zip folder! Obviously, I copied it and put into the XCode project and try running it runs cleanly! :)
I had a similar issue in my project (however not using Cocoapods). It ended up being an issue with an application external to Xcode (Spritebuilder) somehow holding onto a resource within my Xcode project when it crashed. I forced the non-xcode application to close and now the issue is gone
Check your project folder name have any space.Because space creates problem in directory path like "SRCROOT".I removed spaces and project run fine.
I've found that this happens to me frequently. Exact cause unknown, but appears to be switching between git branches that have differences in what pods are being used. In my case simply touching the Pods-xxx-Resources.sh shell script file causes it to speed back up.
Probably not going to work for you, but cleaning the project fixed it for me (Product -> Clean)

Xcode build failure "Undefined symbols for architecture x86_64"

An Xcode beginner's question:
It is my first experience with Xcode 4.6.3.
I am trying to write a very simple console program, that searches for paired BT devices and prints them to an NSLog.
It builds with the following error:
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_IOBluetoothDevice", referenced from:
objc-class-ref in main.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I searched like crazy. The common problem should be a reference to a file, of which only the header files are imported and no implementation (*.m-file) is found by the linker. The IOBluetooth library is however, a standard Framework like the Foundation Framework.
What am I missing in my above statement?
I also have tried building it for a 32-bit machine (build fails again). It is clearly a linker error, however I have no idea, to what it relates, except that there is an issue with finding the implementation for IOBluetoothDevice, on both x86 and x64 architecture, while the header files are from a standard included Framework, called IOBluetooth?
For your information my main code "main.m" being:
#import <Foundation/Foundation.h>
#import <IOBluetooth/objc/IOBluetoothDevice.h> // Note the import for bluetooth
#import <IOBluetooth/objc/IOBluetoothDeviceInquiry.h> // Note the import for bluetooth
int main(int argc, const char * argv[])
{
#autoreleasepool {
IOBluetoothDevice *currentDevice;
NSArray *devices = [ IOBluetoothDevice pairedDevices];
for (id currentDevice in devices){
NSLog(#"%i : %#",[ currentDevice classOfDevice ], [ currentDevice name ]);
}
}
return 0;
}
Thanks for any help or pointers to the right direction.
It looks like you are missing including the IOBluetooth.framework in your project. You can add it by:
Clicking on your project in the upper left of the left pane (the blue icon).
In the middle pane, click on the Build Phases tab.
Under "Link Binary With Libraries", click on the plus button.
Find the IOBluetooth.framework from the list and hit Add.
This will make sure that the IOBluetooth.framework definitions are found by the linker. You can see that the framework is a member of your target by clicking on the framework in the left pane and seeing the framework's target membership in the right pane (note I've moved the framework under the Frameworks group for organization purposes):
UPD
Apple requires to use arm64 architecture. Do not use x32 libraries in your project
So the answer below is not correct anymore!
Old answer
The new Xcode 5.1 sets the architecture armv7,armv7s,and arm64 as default.
And sometimes the error "build failure “Undefined symbols for architecture x86_64”" may be caused by this. Because, some libs (not Apple's) were compiled for x32 originally and doesn't support x64.
So what you need, is to change the "Architectures" for your project target like this
NB. If you're using Cocoapods - you should do the same for "Pods" target.
Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_xxx",
referenced from:
objc-class-ref in yyy.o
This generally means, you are calling "xxx" (it may be a framework or class) from the class "yyy". The compiler can not locate the "xxx" so this error occurs.
You need to add the missing files(in this case "xxx") by right click on your project folder in navigator window and tap on "Add files to "YourProjectName"" option.
A popup window will open your project files in Finder. There, you can see the missing files and just add them to your project. Don't forget to check the "Copy items if needed" box. Good luck!!
I have also seen this error on Xcode 7.2 when the derived data becomes corrupted (in my case I interrupted a build and suspect that was the root cause).
So if the other solutions (notably Chris's and BraveS's which I suspect are more likely) do not fit your problem try deleting derived data (Select: Window / Projects / Derived Data -> Delete) and re-building.
(Added for reference by others - I know the original question has been answered correctly).
Under Xcode 9.0b5 you may encounter this because Xcode 9.0b5 has a bug in it where when you add source code, it does not honor the target settings. You must go in and set each file's target manually afterwords:
In my Case , it was not a library, it was some classes ..
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_ClassNmae", referenced from: objc-class-ref in
SomeClassName" . . .
d: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see
invocation)
Solution
I had several targets in Xcode with several schemas ( Production , Dev etc ) .. some of my newly added implementation ( Class.m ) were missing in
Xcode->Targets->Build Phases->Compile Sources
So I had to add them manually.
then I could compile & build successfully.
I also encountered the same problem , the above methods will not work . I accidentally deleted the files in the following directory on it .
Or
~/Library/Developer/Xcode/DerivedData/
I tried just about everything here but my problem turned out to be the remnants of a previous cocoapods build. What worked for me was:
rm -Rf Pods; pod install
Delete Derived Data (Window/Projects... select your target. click Delete Button)
Rebuild
I have faced this issue many times. This usually comes when you delete your build folder.
The easy solution is to de-integrate and install the pod files again.
pod deintegrate
pod install
When updating to Xcode 7.1, you might see this type of error, and it can't be resolved by any of the above answers. One of the symptoms in my case was that the app runs on the device not in the simulator. You'll probably see a huge number of errors related to pretty much all of the frameworks you're using.
The fix is actually quite simple. You just need to delete an entry from the "Framework Search Paths" setting, found in your TARGETS > Build Settings > Search Paths section (make sure the "All" tab is selected)
If you see another entry here (besides $(inherited)) for your main target(s) or your test target, just delete the faulty path from all targets and rebuild.
I have found this can also occur if you drag a folder with Objective-C files into your project. If that folder appears blue I think it indicates its not properly linked. You can verify this (if you use version control) because whenever you add new files the pbxproj file should update with links to those new files. However you may find that after you added a folder that the pbxproj file did not change (and hence there is a linking error). So you will get auto-complete working and it will find the classes you imported, but when it goes to actually build the image it fails with this error code.
The solution is to not add the folder but rather add the files. Do this and you should see the pbxproj file update and it should fix this error.
This also assumes you've done what was suggested above and have properly linked all the right frameworks.
I know it's an old question but today got the same error and non of the above solutions worked.
Have fixed it however by setting option:
Project -> Architecture -> Build Active Architecture Only
to Yes
and project compiles and builds properly
I had the same error, because instead of deleting a file I simply removed references to it. Locating the file in Finder and removing it helped.
In my case, I built a custom framework with Deployment target set to 9.1, but the Deployment target of my app was lower, which supports 8.1. Minimize the custom framework Deployment target solved my problem.
If you're getting this error when trying to link to a C file, first double check the function names for typos. Next double check that you are not trying to call a C function from a C++ / Objective-C++ environment without using the extern C {} construct. I was tearing my hair out because I had a class that was in a .mm file which was trying to call C functions. It doesn't work because in C++, the symbols are mangled. You can actually see the concrete symbols generated using the nm tool. Terminal to the path of the .o files, and run nm -g on the file that is calling the symbol and the one that should have the symbol, and you should see if they match up or not, which can provide clues for the error.
nm -g file.o
You can inspect the C++ symbols demangled with this:
nm -gC file.o
I got it solved by adding "-lc++" in Other Linker Flags in Build Settings.
In my case problem was compiled framework architecture.
I'm running Xcode 11 and using Swift 5.1
I had 3 target like:
MyApp
MyAppTests
MyAppFrameWork
I was tried to run tests but MyAppFrameWork product was compiled for Generic iOS Devices and the Test target needed an arm x86-64, So I rebuilt Framework for iOS Simulators and test cases successfuly start running.
This is also happend with apple M1 chip.
Here is my solution just check Open using Rosetta
Steps:
Go to application > right click xcode > get info > check Open using Rosetta
Restart the system.
I am late to the party but thought of sharing one more scenario where this could happen.
I was working on a framework and was distributing it over cocoapods.
The framework had both objective c and swift classes and protocols and it was building successfully.
While using pod in another framework or project it was giving this error as I forgot to include .m files in podspec.
Please include .swtift,.h and .m files in your podspec sources as below:
s.source_files = "Projectname/Projectname/**/*.{swift,h,m}"
I hope it saves someone else's time.
in my case I had to add
target 'SomeTargetTests' do
inherit! :search_paths
end
to my podfile and then delete the /Pods directory and run `pod install`
(Xcode 10.1)
This might help somebody. It took me days to finally figure it out. I am working in OBJ-C and I went to:
Project -> Build Phases -> Compile sources and added the new VC.m file I had just added.
I am working with legacy code and I am usually a swifty, new to OBJ-C so I didn't even think to import my .m files into a sources library.
EDIT:
Ran into this problem a second time and it was something else. This answer saved me after 5 hours of debugging. Tried all of the options on this thread and more. https://stackoverflow.com/a/13625967/7842175 Please give him credit if this helps you, but basically you might need to set your file to its target in file inspector.
All in all, this is a very vague Error code that could be caused for a lot of reasons, so keep on trying different options.
What helped me was adding s.static_framework = true to my /podspec in the project that was throwing the error.
For me, this started to happen after merge conflict.
I tried to clean and remove build folder, but none of it helped. This issue kept happening regardless. Then I relinked the reference by deleting the groups that was problematic and re-added to the project and it worked.
Could also be an #include <windows.h> in the .c file that you're trying to compile.
Sometime, I forget to copy library from Release-universal and mistakenly copy from Release-iphoneos. Usually Release-iphoneos contains .a file which has been pruned for X86. and so it gives the error.
in my case, removing selection of target membership and then select again fix the issue.
Check William Cerniuk answer with the attachment photo.
Undefined symbols for architecture x86_64
I have run on this issue when used CocoaPods with some dependency which did not have specific version, that is why after pod update it downloaded the latest version which included some breaking changes
Upgrade dependencies and code for using them
Set specific version of pod
Remove Derived Data[About] folder
In my case I was getting this error: Undefined symbols for architecture x86_64: "_OBJC_CLASS _ $ _ RCTImageLoader"
And I was able to fix it by adding the following line in my Podfile file:
pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image'
Reference
It happens when you are using architecture arm6, arm7 in your current project but any 3rd party framework which you are trying to consume in your project is built over x86_64.
For e.g If you are using Cocoa Pods in your project, then you need to add following script to make sure all 3rd party frameworks ensure arm6, arm7. i.e
Sample podfile with script to be add at end
target 'XYZ_ProjectTarget' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for XYZ_ProjectTarget
pod 'pod_name'
target 'XYZ_TargetTests' do
inherit! :search_paths
# Pods for testing
end
target 'XYZ_TargetUITests' do
# Pods for testing
end
end
post_install do |installer_representation|
installer_representation.project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ARCHS'] = 'armv7 armv7s'
end
end
end

CocoaPods Errors on Project Build

I'm unable to build a project that uses CocoaPods. I get the following errors:
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.`
$ pod install seems to work fine and adds a Pods Project to my Workspace. I've tried $ pod update but this doesn't help.
It seems that PODS_ROOT is not being set.
Podfile:
platform :ios, '6.0'
workspace 'Example.xcworkspace'
xcodeproj 'example/Example.xcodeproj'
pod 'TestFlightSDK', '~> 1.3.0-beta.5'
pod 'TestFlightLogger', '~> 0.0.2'
pod 'CocoaLumberjack', '~> 1.6.2'
pod 'Reachability', '~> 3.1.0'
pod 'SBJson', '~> 3.2'
pod 'MKMapViewZoom', '~> 1.0.0'
I had a similar problem when I did major changes to my Podfile. My solution was to remove the workspace file and run pod install again:
rm -rf MyProject.xcworkspace
pod install
TLDR: This is most likely a bug with Xcode and closing and reopening the project is usually the simplest fix. Assuming everything else is configured properly.
I occasionally get the same error when deleting the Pods directory and then running pod install.
Everything appears correct in the project info:
However, when I go to the target's User-Defined Build Settings, the PODS_ROOT entry is either entirely missing or is empty for one or more configurations. Which causes the following error on build:
The simplest fix is to close the project in Xcode and reopen it.
If you go to the target's Build Settings and filter on All, you will now see the PODS_ROOT entry with no errors:
It should now build with no errors.
Note: Even Cocoa Pods' official AFNetworking iOS Example has this problem, which leads me to believe that it is a bug with Xcode.
An alternative fix is to manually change the configuration to None, then back to its original value:
Go to the target's Build Settings and make sure the value of PODS_ROOT equals ${SRCROOT}/Pods in "User-Defined" section.
update: a podfile.lock is necessary and should not be ignored by version control, it keeps track of the versions of libraries installed at a certain pod install. (It's similar to gemfile.lock and composer.lock for rails and php dependency management, respectively). To learn more please read the docs. Credit goes to cbowns.
In my case, what I did was that I was doing some house cleaning for my project (ie branching out the integration tests as a git submodule.. removing duplicate files etc).. and pushed the final result to a git remote repo.. all the clients who cloned my repo suffered from the above error. Inspired by Hlung's comment above, I realized that there were some dangling pod scripts that were attempting to run against some non-existent files. So I went to my target build phase, and deleted all the remaining phases that had anything to do with cocoa pods (and Hlung's comment he suggests deleting Copy Pods Manifest.lock and copy pod resources.. mine were named different maybe b/c I'm using Xcode 5.. the point being is to delete those dangling build phases)..
So it seems that CocoaPods didn't set the Configurations for my Project. They need to be based on the Pods.xcconfig which is found in the Pods/Target Support Files/Pods. To get this to work I had to do the following:
Drag this file into my Xcode Project in Xcode, choosing not to copy.
Now there is a reference in our project, we can set the configurations:
I then had another build error which may or may not have been related. The path to the shell script defined in the Copy Pods Resources was incorrect.
"${SRCROOT}/Pods/Pods-resources.sh"
Resolved incorrectly. It seemed that SRCROOT was adding an extra dir that didn't exist into the path. So I hard coded the path to the Project folder.
This allowed me to build.
Why is it that so many things that are supposed to save you time end up eating it up?
Note: Please see #abood's answer for explanation.
I have a similar issue this is what worked:
In Xcode:
Clean
Delete Derived Data in Xcode/Window/Organizer/Project/Your Project
Pod directory (it contains config files, delete files not just references!)
Removed all references to the pod config files for every target in Project/Configurations (debug/release)
Removed "Targets/Build Phases/Copy Pods Resources" from all Targets
Removed "Targets/Build Settings/User-Defined/PODS_ROOT" from all Targets
Quit Xcode
In your project directory:
rm -rf Pods
(Optional) rm -rf YourProject.xcworkspace
rm -rf Podfile.lock
pod install
Open YourProject.xcworkspace in Xcode
I got rid of the same problem by doing following steps:
Xcode->Product->Clean Build Folder (hold alt key on Product to see it)
Open Xcode->Window->Organizer and select Projects tab. Then find your project and delete derived data of the project.
Simply resolved by doing the following:
(sudo) gem install cocoapods
pod install
clean and build
it seems the problem was caused by one of our team members having a more recent cocoapods gem installation.
open .xcodeproj file in sublime text
remove these two lines, if you have clean pods folders, i mean if you got the errors above after you removed pods folder
Had the same issue saying
/Pods/Pods-resources.sh: No such file or directory
even after files etc related to pods were removed.
Got rid of it by going to target->Build phases and then removing the build phase "Copy Pod Resources".
I had the same problem recently. I have tried every possible advice, nothing except this plugin has worked for me:
https://github.com/kylef/cocoapods-deintegrate
After the cleaning up of the current cocoapods integration, what's left to be deleted are Podfile, Podfile.lock and the .xcworkspace. Then just install all over again.
I hope I will help someone with this.
This issue got it solved.
Select Target of your Project
Select Build Settings
Open User-Defined drop-down list
Change value of key PODS_ROOT to ${SRCROOT}/Pods
I think it has a bug here.
For me, I delete Pods folder and Podfile.lock and do the pod install again to solve the problem.
This message is ignoring..:(
It wasn't very intuitive. I went to the base project settings and then I hardcoded paths to my pod.lock and pod.manifest under Check Pods Manifest.lock, because they stayed in different folders in fact, so my paths looked like this:
diff "/Users/admin/Desktop/Experimental/projectfolder/Podfile.lock" "/Users/admin/Desktop/Experimental/projectfolder/Pods/Manifest.lock" > /dev/null
if [[ $? != 0 ]] ; then
cat << EOM
error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.
EOM
exit 1
fi
You can try the following. It fixed for me.
install gem install cocoapods-deintegrate
install gem install cocoapods-clean
goto pod deintegrate
pod clean
pod install
The plugins will be remove from cocoapods for your project and will install freshly.
In my case, this was a test target that I removed all the pods from inside my podfile (because I added pods that I later realized I did not need in that target). None of the other solutions here worked for me.
Go to the Build Phases tab in the project settings for the target
that's causing trouble.
Delete the section named "Check Pods Manifest" and "Copy Pods
Resources"
Inside "Link Binary With Libraries" remove libPods-YourTarget.a
In your project settings in the Info tab expand "Configurations" and
set the configuration for the target to None for both debug and
release. (This will fix a couple of missing file warnings)
Delete your project's derived data (Window > Projects > Delete [next
to your project) and restart Xcode. Build / run target.
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
I had same problem with the my IONIC project, i tried above all solutions but not luck.
If you have same problem still, check weather below settings are present in Build Settings -> User-Defined settings or not
1.PODS_ROOT 2.PODS_PODFILE_DIR_PATH
If not present then add it,
PODS_ROOT = ${SRCROOT}/Pods
PODS_PODFILE_DIR_PATH = ${SRCROOT}/
It will solve problem, solution link
In my case the problem was in the wrong way. solution here http://guides.cocoapods.org/using/troubleshooting.html
If something doesn’t seem to work, first of all ensure that you are
not completely overriding any options set from the Pods.xcconfig file
in your project’s build settings. To add values to options from your
project’s build settings, prepend the value list with $(inherited).
I had this issue.
The way I fixed it was by completely deleting the Pod implementing and re-implementing it. Make sure to delete "Copy Pods Resources" and "Check Pods Manifest.lock" from "Build Phases" on all targets as stated here: How to remove CocoaPods from a project?
For me to get rid of this error, I needed to delete the Pods directory and delete the Podfile.lock file.
In my case I did put Podfile.lock & Manifest.lock in source control, but I forgot to add Pods-Project.debug(release).xcconfig files to source control (by mistakenly adding *.xcconfig to .gitignore), then I got the same compile errors with exactly the same reason, PODS_ROOT is not being set.
So if the goal is that after cloning the repo, the project can immediately build and run, without having CocoaPods installed on the machine, you either add entire Pods directory in source control or add Podfile.lock, Manifest.lock, project's xcconfig files and Pods xcconfig files to source control.
I didn't put the private .xcconfig that merges the build settings with the default CocoaPods configuration to source control.
After spending hours i found the solution go to "Build Phases"
Then "Check Pods Manifest.lock"
Tick "Run Script only when installing"
Thank me later ;)
I have created multiple targets before I ever used pods. Later when I started to compile the other targets I had to add link_with with the list of targets in my Podfile.
I had the same issue. After retracing my recent steps, I found that adding a target declaration for a new target, followed by running pod install, was the cause of the problem:
Resetting my branch and cleaning my project did not work, since Cocoapods modified at least one file that is not under source control. I know this because once I reset the remote branch to a commit before adding the extra target, and re-cloned the repo, the problem no longer existed.
If you have a watchOS target: I found that suddenly, having pods in the watch extension but not in the watch target itself broke things with this same error. The solution was to add the pods to the watch target also.
gem install xcodeproj
may help you.
See pod install fails with abort - New Swift project.
if you added new target after creating Podfile, just delete Podfile, Podfile.lock , Pods folder and workspace
then
init pods ->then put your pods
pod install
After trying the above, I realized I was getting an error on pod install
[!] CocoaPods did not set the base configuration of your project
because your project already has a custom config set.
This was causing the error, because cocoapods was not adding the .xcconfig file to my project.
To solve this I went to the Info tab of my project. Set my Based on Configuration File to None for all schemes and targets. Then re-ran pod install
See this link for more information.
Cocoapods Warning - CocoaPods did not set the base configuration of your project because because your project already has a custom config set
In my case, I accidentally typed an unnecessary dot at the end of the config file which caused this strange problem. Please make sure your config file does not contain any errors!