XCode can not open .xcworkspace but AppCode can [cause CocoaPods] - ios

I used CocoaPods in my project, after creating the project it can be opened by both XCode and AppCode correctly, then I wrote the code in AppCode for a few days, today I want to use XCode to open the .xcworkspace file but fail,XCode just displayed .xcodeproj file , I can not watch the whole project. Anyone meet the same problem?

I had a similar issue. The issue was that all toolbars and panels were hidden. In XCode Went to View > Show Toolbar etc. which fixed it.
Might not be the same problem but worth mentioning I think.

Related

ERROR: "This document requires at least Xcode 12.0"

Opened a project in Xcode 12.0 that I started on Xcode 11.x the other day. Without thinking, I made some edits in the interface builder and when I opened the project back up in Xcode 11.6 I got the This document requires at least Xcode 12.0. error. I can't build the project or open the main storyboard file.
Any thoughts on what I can remove to open/build this project in Xcode 11.6?
The recovery suggestion is Recovery Suggestion: This version does not support image references. Open this document with at least Xcode 12.0., but I'm not sure what that means or where to look.
I had the same issue while loading another author's project. The solution that worked for me was to open Main.storyboard in a text editor such as Sublime and change the line:
<capability name="Image references" minToolsVersion="12.0"/>
to
<capability name="Image references" minToolsVersion="11.0"/>
I was able to build successfully after this and there was no error.
Thanks for the two suggestions! Turns out the issue didn't originate from the storyboard, although that's where the error was being thrown. Instead it was caused by a navigationItem image that I was setting programmatically in one of the project's ViewController files. The icon ended up being exclusive to iOS 14+, which was why the project wouldn't build in Xcode 11.6.
I switched the icon and everything built without issue.
To run your project with previous Xcode versions, try the following:
Open the affected .storyboard file with an external editor (i.e. TextEdit, TextWrangler or any other..)
Search in the xml document for all keys "minToolsVersion"
If you find some key with value minToolsVersion="12.0"downgrade it manually to be compilant with your XCode version.
Save the file and come back to XCode
Now the error should be disappeared.
Select your storyboard > Right Click > Open As > Source code > Search for this key "minToolsVersion" from there you need to decrease your version as per your xcode.

Could not build module 'Foundation', 'UIKit, 'CoreFoundation' on Xcode 9.3 and Xcode 9.4 [duplicate]

Suddenly it stops building application in device. In simulator its working but when I connect the device and try to run it in device it gives me an error:
Could not build module UIKit
I tries a lot but couldn't solve it.
A full clean + deleting the derived data worked for me.
Be sure to fix any code that may be broken because UIKit cannot be installed, before the clean and build.
So, for example, if you are trying to reference UICollectionViewController, and need UIKit to reference it, comment out the code that is using UICollectionViewController, comment out the import for UIKit.
Then clean, build. Now uncomment import UIKIt, build. NOW uncomment UICollectionViewController code, build again.
Please don't make the same mistake like I did. In my case, I accidentally typed some words into Foundation framework file.
Something that might help would be to set the Derived Data location to "Relative" in XCode preferences, then Clean & Build
For some reason your UIKit.framework is corrupted, either copy a working UIKit.framework from somewhere else into
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks
Or reinstall Xcode the fix the issue.
I accidentally edited the Foundation framework file
so UIKit.framework got corrupted. The only solution is recover the original.
You have two ways to achieve the same:
Just reinstall Xcode. OR
copy the Framework from another machine with the same XCode version and paste into yours.
Location:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks
If you have two Xcode then uninstall both and again install Xcode. It worked for me.
If cleaning the project and deleting the 'derived data' doesn't work,
try to change the 'Deployment target' (at 'General' tab) from 7.0 to 7.1
Check whether the appropriate target is selected or not from the "active scheme selector". Selecting "Generic iOS Device" solved my problem.
Click to select simulator
Select "Generic iOS Device":
Make sure none of the files are edited in the UIKit framework located inside Xcode.
Cleaning Derived data worked for me
Check the tool chains installed and select the right xcode tool chain. In my case i changed it from Swift 4.0 to xcode 9.2 and it worked.
In my case, after cleaning the project, only restarting my Mac helps.
Cleaning the project and restart xCode worked for me.
I am also facing this issue for very long time and after trying all the suggestions given in the different portals, i came to know that the issue is with the device you want to run the application. Device have latest iOS and your Xcode is not supporting that iOS.
For example you have Xcode 7.2 and want to run the application on device which have iOS 9.2.1. So you only need to update your Xcode.
And one more thing Base Sdk in Build Settings is always greater or equal to the software version number on your development device.
Already tried all the solutions above. I still could not solve my problem. So I uninstall the Xcode and reinstall it. It worked magically.hope this helps.
Suppose you have changed or deleted anything in the UIKit framework, then shows this error.
If you are able to find that class or .h file to be changed or deleted, then replace that whole file content in that .h file from other system's Xcode (confirm that should be similar Xcode version).
For example, In UIView.h file - I have deleted a method and closed and opened the Xcode. Then I couldn't reverted that code.
I tried with delete derived data,delete application from project list but when i delete xcode and install new one its working so its best way just delete xcode and install new xcode.
This error happened to me when I accidentally modified the uikit framework. Removing and re-adding the uikit framework in link binary with library, cleaning derived data and restarting xcode didn't work. I don't want to uninstall my xcode so I tried to copy codes of the class that I might have modified from other pc with xcode that works fine and paste it to mine. It worked!
If your project builds for another target (e.g. it builds for simulator and NOT your device), then it's confirmed you accidentally edited one of the header files of the frameworks for that target. The affected framework is the one you are receiving compiling errors for.
It worked for me after remove all folders in DerivedData folder.
My Issue causing this same error was due to working in a workspace created by coco pods, somehow the link to the UiKit Framework had been lost from the original project.
To solve this i just reopened the xCode project not the workspace and re added the missing UIKit framework, saved the project and closed it, re opened my workspace for the project and the annoying nag messages caused by this were fixed. Hopefully this helps someone else.
I had this issue, and I set Device on Generic iOS Device, clean project, make build. Then I switched device to my real device and run project. The error does not appear.
Cleaning some unnecessary Xcode data using DevCleaner for Xcode app worked for me.
My error was a wrong version of command line tools - go to Preferences->Locations and change the command line tools version - quit xcode and try again.

Xcode 9 - Fix all in Scope greyed out

With Xcode 8 the errors could be fixed using the "Fix all in Scope", but in the latest Xcode 9 that option is always greyed out. Do you have an idea if I have to set up something or if it's just a bug?
The Xcode I'm using is the App Store version, build number 9A235, so it's not a beta.
Usually it helps to clean "derived data", the project and to restart your mac. Feels like Windows but I have good experiences with this kind of bugs.
Navigate to the deived data folder in Finder. For this open tab Locations in XCode Settings where you will find a link. Delete all data within derived data folder. (No worry - it will be restored by XCode)
look for and select the page you have error and there is the word fix
and go Editor >>>> Fix All Issues

Xcode 6 Interface Builder "cannot open compiled nibs" error, FiksuSDK

I have an app that runs great in Xcode 5, using CocoaPods.
When I open the app on Xcode 6 and hit build and run, I get four errors from the FiksuSDK about compiled nib files.
On the side, it states that I do not have permission to view it, but tapping on it shows the error: "The document "FMVerifyViewController.nib" could not be opened. Interface Builder cannot open compiled nibs." I don't directly call any of these nib files, however it's possible that the Facebook API does.
Screenshots attached.
I've tried removing the Pods directory, deleting derived data, updating pods and restarting Xcode. Nothing.
Any help would be really appreciated.
Screenshots:
Go to the "Build Settings" of your Project and set "Strip NIB Files" in "Interface Builder NIB Postprocessor - Options" to NO - worked quite well for me :)
This isn't a very good answer, but I had this same problem and in order to keep developing (until this gets figured out), I just removed those 4 nibs from the project. Just go to the project file, select the target you're building against, go to the "Build Phases" tab, and delete those 4 nibs from the "Copy Bundle Resources" section. Your project should build and run fine for the time being (I haven't encountered any negative effects to not having these nibs). By the way I think they're from the Fiksu SDK, not the Facebook SDK.
The error messages unfortunately are misleading because it's not a permissions problem and the nibs are valid. It appears that because they are provided as symlinks to the resource files, Xcode complains.
Fiksu just released a new version of their SDK where this issue is fixed. (look for version 4.3.1)"
Disclosure: I am a Fiksu Employee

Xcode Crashes when adding UIViewController in Interface Builder

I was in Xcode and I went to edit a nib file. I tried to drag on a UIViewController from the objects library, but as soon as I did Xcode crashed. I had never had this problem before, but now I cannot add a UIViewController to the nib file (the problem persists for other files in the same project and other files in other projects).
Originally, the problem occurred in the Developer Beta of Xcode 4.5 that I was using, but now when I tried in the old version of Xcode the problem was there also.
Basically, I have been unable to find a way to get this problem to stop. If anyone has experienced this problem or knows how to fix it, that would be so great.
Thanks,
Luke
What about trying to delete all Xcode preferences files? It seems like the latest Xcode beta broke something there...
Have a look at the following folders:
/Users/xyz/Library/Application Support/Developer/Shared/Xcode
/Users/xyz/Library/Application Support/Xcode
/Users/xyz/Library/Developer/Xcode
/Users/xyz/Library/Caches/com.apple.dt.Xcode

Resources