Xcode creating a Realm target by itself - xcode

This is what it shows:
And when I click Manage Schemes I get this:
This is how it added the schemes:
however I do not have Realm in my pods or my project:
I used to at some point, but got rid of it. Also at some point I had installed Realm package with Alcatraz, but I also deleted that. I am using Swiftlint but I guess they are not related. So there should no reason for my scheme to automatically change to Realm randomly. (Usually when I restart Xcode or clean build)
What is this and how do I get rid of it completely?

It looks like a CocoaPods or Xcode cacheing issue to me. Try this:
pod deintegrate || rm -rf Pods
pod install --verbose
You can also try deleting derived data and cleaning the build folder in Xcode; a number of our users have reported that this solved their CocoaPods issues. To clean the build folder, hold down the ‘Option’ key while opening the ‘Product’ menu, then choose ‘Clean Build Folder…’. You can also type “Clean” into the Xcode help search menu and select the ‘Clean Build Folder…’ menu item when it shows up in the search results.

Related

How do I archive Xcode project?

I am currently having issues when attempting to archive my project in Xcode. The following error below appears when archiving:
The link Xcode 12 Error: Multiple commands produce AccessibilityResources.bundle mentions to remove React-Core.common-AccessibilityResources from my target but I do not have this under my target. Can someone please assist?
I am using Xcode version 12.1.
This is what I have in the workspace settings:
Thank you.
I changed the derived data location but still getting the same error:
I am now seeing the below error after updating my Podfile.
Current error:
Updated Podfile:
Have a try with the below solution.
Initially clean the build cache data with the below steps:
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 the Derived data section and select your project folder and close the workspace and Xcode then delete the project directory from the derived data directory.
Open the workspace again in Xcode and clean and rebuild the project.
Also, make sure that you have applied pod install after the package installation.
Then, open workspace and set the active scheme as Any ios Device (arm64, armv7)
Click on Project from top Xcode Menu
Then select Archive.
Have a break till the Archive process completes.
Remove the below lines from PodFile:
use_flipper!()
post_install do |installer|
flipper_post_install(installer)
end
and do pod install in ios directory.

Using 'GoogleMaps' and 'GooglePlaces' pods, when archiving iOS build receive error for multiple commands produce GoogleUtilities target

Having trouble archiving - I receive a Build System Information error that says
Multiple commands produce '.../Library/Developer/Xcode/DerivedData/.../Build/Intermediates.noindex/ArchiveIntermediates/.../IntermediateBuildFilesPath/UninstalledProducts/iphoneos/GoogleUtilities.framework':
1) Target 'GoogleUtilities-00567490' has create directory command with output '.../Library/Developer/Xcode/DerivedData/.../Build/Intermediates.noindex/ArchiveIntermediates/.../IntermediateBuildFilesPath/UninstalledProducts/iphoneos/GoogleUtilities.framework'
2) Target 'GoogleUtilities-ac14cd06' has create directory command with output '.../Library/Developer/Xcode/DerivedData/.../Build/Intermediates.noindex/ArchiveIntermediates/.../IntermediateBuildFilesPath/UninstalledProducts/iphoneos/GoogleUtilities.framework'
I recently updated to the latest version of Xcode (v 10.0). I am also using Cocoapod version 1.6.0.beta.1
Using GoogleMaps pod version 2.7.0, GooglePlaces pod version 2.7.0
When I run 'pod install' it also installs 'GoogleUtilities (5.3.0)'.
I tried deleting my Podlock, Podfile, .xcworkspace, etc and starting over with a new Podfile, pod init, pod install, etc. after updating Cocoapods but still no luck.
I'm looking for a duplicate relating to GoogleUtilities or Places or Maps in Build Phases within Embed Pod Frameworks, but not having much luck. When I look inside the Pods folder, I do see two GoogleUtilities frameworks, "GoogleUtilities-00567490" and "GoogleUtilities-ac14cd06", but both appear not to have the exact same contents.
Only now experiencing this issue after updating Xcode to version 10.0.
For me, the same issue was coming and Most of the people saying to change the build system to legacy, but when I tried its It started swift compilers error. resolved as mentioned below.
Go to your target and click on (your_app_name_target).
Select Build Phases.
Expand Copy Pods Resources.
See the section Output Files.
This section should be empty. Remove any entry there.
Rebuild your Project.
Going to File > Workspace Settings and then changing the Build System from "New Build System (Default)" to "Legacy Build System" will allow you to archive for now. Hopefully, another solution comes along for using those pods and the new build system in Xcode 10.0

Multiple targets for project in xcode

I am using xcode 7.3.1. After pod update, it's showing multiple project target in the project having same details without any change. How can I fix this? If I delete any one of these, xcode crashes and when we reopen even the other option comes in red and we dont have any project.
Have you tried to delete the workspace file and the pod directory, and re-launch a pod install ? The workspace file does not hold any important information to be retained in CocoaPods.
If you have the same problem after regenerating, it means there is an error in the Pod file.

Xcode: ld: library not found for -lAFNetworking

Because of this one reason, build always fails...Any ideas about what I could try?
EDIT: the solution is to open the xcworkspace instead of the xcproject!
Might be you are opening .xcodeproj file after installing pods. Close the project and open .xcworkspace file.
Have the same issue.
What I did with the help of https://premium.wpmudev.org/forums/topic/anybody-solved-this-linker-command-failed-with-exit-code-1 and Adlair Cerecedo-Mendez
Delete the "Pods" project on the left panel of Xcode.
Close Xcode and delete this file in the finder too.
Install pods again.
Open Xcode and clean.
Verify that the build option "Build Active Architecture Only" is set to "NO" for your project but also for your Pods project (selection with left panel).
Click on your project Scheme (top, near the stop button) and "Manage Scheme".
Check, select all your pods libraries and close.
Then, for all libs, select them (scroll the list) and build manually for the selected architecture.
Every time you change your architecture (simulator, device or for archive(Generic iOS Device)) you must do the above step: namely, manually build each libraries by selecting them in your scroll list one by one, and only than build and run your main project.
Seems a bit WTF, but it is the only way I resolve this issue...
I Had this Issue several Times with PODS Libraries.
Here is something you can Try:
Run pod cache clean --all and pod install again.
Check your Header Search Paths and Library Search Paths, Remove all entries and place $(PROJECT_DIR) in recursive mode and $(inherited) as a Second Entry
Go to your target Build Settings -> Other linker flags -> double click . Add $(inherited) to a new line.
Make sure Build Active Architecture Only is set to NO in the Pods project settings.
I'm thinking on two possibilities:
1) Install cocoapods-deintegrate project:
$ gem install cocoapods-deintegrate
Then run $ pod deintegrate, after that run $ pod install again. If it not works, then...
2) You can try open your Pods project and create new scheme for the target that you need, in this case for AFNetworking.
When the static library is created, then add it to your Frameworks references into your main project.
Hope that helps.
I have in project->TARGETS->Build Phases ->Link Binary With Libraries one "extra" framework that remains from recent project. Delate it and all run smoothly
Had a similar issue ... took a while to realize that I had updated my app's "iOS Deployment Target" to iOS 9.0, but the Pods project's "iOS Deployment Target" was still iOS 8.0!!!
I encountered this error when I downloaded some code from github. I tried to build .xcodeproj file but it failed giving the library not found error. I then opened .xcworkspace file and build that file first by clicking Product -> Build for -> Running. The workspace file built fine with no errors. Then in workspace file I changed scheme to the xcode project I was trying to build, and clicked Product -> Run. The app got built and ran with no errors.
I had this issue while using fastlane with a ReactNative project. I had added a dependency that required cocoapods.
My Fastfile looked like this:
...
gym(
scheme: "AppName",
project: "./ios/AppName.xcodeproj"
)
....
And had to change it to the workspace like this:
...
gym(
scheme: "AppName",
workspace: "./ios/AppName.xcworkspace"
)
...
For me all this thing not help. Only delete in Build settings project.
open xcode, from the top left select the pod library that is being shown as not found.Use 'Command B' to build this pod, then again select your target scheme and run.
For me this fixed it.
Use the xcworkspace to build instead of the xcproject?
This usually happens when using Cocoapods and you are building from the xcproject which doesn't know about the cocoapod libraries.

How do I configure my project for Cocoa Pods correctly?

In some of my past projects, Cocoa Pods wasn't configured correctly and it would lead to undesirable things such as needing duplicate Cocoa Pod projects in the Project Navigator, or pod files having to be checked in to version control.
How do I install Cocoa Pods correctly and verify that my Directory structure and Project Navigator structures are set up properly?
The best way to use Cocoa Pods is to follow the official example's lead.
This consists of several steps.
Setting up Cocoa Pods for the first time
1. Install Cocoa Pods on your computer
Begin with the Getting Started Guide to install Cocoa Pods on your computer.
2. Create a Podfile
Do not create the Podfile in Xcode, since it should not be part of your project!
Create the file in your favorite text editor, and save it at the same level as your .xcodeproj file.
An example of a Podfile's contents are:
pod 'CupertinoYankee', '~> 1.0'
3. Run pod install
Navigate to your Podfile's directory in terminal and run pod install.
4. Open the generated workspace
Once you run pod install, you will see a message such as:
[!] From now on use MyProject.xcworkspace.
Close the Xcode project, and open up the generated .xcworkspace file.
Understanding the Changes
It is always useful to know what changes were made to your project in case things go wrong.
1. Directory structure
You should have started with a structure such as:
... then manually added a Podfile:
After running pod install, your directory structure now looks like this:
Notice how the only new objects are:
MyProject.xcworkspace
Podfile.lock
Pods
2. Project Navigator
In Xcode, you started with this:
... and ended with this in the new workspace:
For reference, here is an expanded look at the new directory structure:
Obviously, the Pods project was added to the Project Navigator, but there are a few other key things to notice:
Notice how Podfile is located at the root of the MyProject folder in Finder, but is inside of the Pods project in Xcode's project navigator.
Likewise, notice how Pods.xcconfig is located inside the Pods folder in Finder, but is inside of the MyProject in Xcode's project navigator.
3. Configurations
These are the same screenshots as before:
In Xcode, you started with this:
... and ended with this in the new workspace:
Notice how under Configurations, the "MyProject" target now has Pods specified.
This is important because otherwise PODS_ROOT will not be set up properly (among other things), and when you build, you will get errors.
4. PODS_ROOT added
Your target's Build Settings went from this: (Note: this is scrolled all the way down)
... to this:
Notice how PODS_ROOT was added as a User-Defined setting.
Note: this part of the configuration sometimes gets bugged out when reinstalling Pods, so you may need to close and open the Xcode project to fix it.
5. Other changes
You can see a complete list of the changes here.
In my case: On my project SwiftLint was added on Build Phasees -> SwiftLint as below image My root Folder structure was Volume/Project Files/iOS Project Files/Office Projects/project-name. As you can see there were space on my Directory structure , SwiftLint executed on build phase create problem for those space and show a no directory found error. After changing the high level directory by renaming like the below image solved my problem

Resources