Xcode 9 cannot go to method definition (Cocoa pods, Rxswift) - xcode9

I'm running into an issues with Xcode 9.
I have a new project setup with RxSwift 4.0 installed through CocoaPods.
The issues is I cannot go to method definition using command + click command
Xcode always display this error
Anyone know what is the error about and how we can resolve it in order to view the method definition (I believe it will be inside RxSwift Or RxCocoa pods).

I believe it is Xcode 9.0.1 bug, and has nothing to do with a particular framework, because in my case, it often happens even when Cmd+clicking on classes defined within the same project.
As for solution: just click on another file and then go back, popover will disappear. Then try again, sometimes it just works.
Also, keep an eye on Activity Monitor: after a while SourceKitService (part of Xcode 9) eats up a lot of memory (like 10+ Gb), in this case just Force Quit that SourceKitService process.

Related

100+ "Class implemented in both MapKit and VectorKit" warnings with Xcode 9.0.1 and above

While running my project (which doesn't even use MapKit), my console gets spammed with more than a hundred class duplicate warnings:
objc[6377]: Class ___MKPlaceBusinessInfoItemAccessibility_super is implemented in both /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/AccessibilityBundles/MapKit.axbundle/MapKit (0x12f128f00) and /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/AccessibilityBundles/VectorKit.axbundle/VectorKit (0x12f2187b0). One of the two will be used. Which one is undefined.
These warnings were not present with Xcode 9.0.0, I am only experiencing this on Xcode 9.0.1 and above.
I am aware that this is a bug and I found a radar that is about this issue. Is there a way to silence these warnings without affecting the visibility of other SDK warnings?
This is actually a bug in the current iOS Framework and has nothing to do with anything in your app, module cache, libraries, etc. The reason this appears to be non deterministic is that it is only there when the Accessibility Layer is active, which it isn't on the simulator, except under very specific circumstances. The three I'm aware of:
The Accessibility Inspector is on
UI Instrumented Testing
VoiceOver for OSX is On (other ATs as well)
To get this to go away you should:
Exit Accessibility Inspector (if it's on)
Open Simulator
Hardware -> "Erase All Content and Settings"
Re run application.
Literally NEVER run this simulator with the Accessibility Inspector
Literally NEVER run UI tests on this simulator, which also rely on the Accessibility Layer to do their work, though I don't think doing so will cause the error to stick around until you "Erase all...." again, it will just be present for that test run.
Every time you do one of those last two bullet points, you will have to clear the data again...
The core issue is that MapKit and VectorKit both link to core accessibility bundles, but apparently have not done so dynamically, so those bundles are included in both modules. Such warnings are very safely ignored, though very verbose and frustrating.
Unfortunately there is no other fix for this... maybe you could download an old version of the simulator if you don't need iOS 11 features. Or just don't run instrumented tests/Accessibility Inspector/VoiceOver/I HOPE THEY FIX THIS SOON!
Got the same issue on 9.0.1.
You should quit Xcode and all Simulators.
Run rm -rf ~/Library/Developer/Xcode/DerivedData/ModuleCache.
Start Xcode again.
This issue was solved for me.
I don't give a damn about accessibility in the simulator so I just renamed one of the duplicate files so it wouldn't be found:
mv /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/AccessibilityBundles/MapKit.axbundle/MapKit /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/AccessibilityBundles/MapKit.axbundle/MapKit_
lol
Resetting the iOS simulator fixed this for me.
Simulator -> Hardware -> Erase All Content and Settings...
Exactly the same problem, in my case, I tried to delete all the files in DerivedData folder, but still not work.
And later I found that if I switch to another kind of simulator, for instance, switch from 'iPhone 8' to 'iPhone 8 plus', the warning would disappear.
So, simply delete the 'iPhone 8' simulator from simulator list, and then add the 'iPhone 8' simulator again, it works.
Not sure if the problem will come again, since it's also my third time dealing with this.
As you can see, there's something wrong with CoreSimulator of /Applications/Xcode.app. Apple Xcode Developer defined this symbol in both MapKit and VectorKit, which is the fundamental error.
You cannot modify Xcode, so only Apple's Staff can solve it.
Just stop wasting your time, except falling back to Xcode 9.0
Solved!
-On simulator
--Hardware
----Erase all content and settings
-Close xcode and simulators
-remove the content of ~/Library/Developer/Xcode/DerivedData/ModuleCache
-Start xcode...
My case is a bit different: I met this issue while running XCUITest.
After launching the XCUITest process, the target app crashes upon launch.
However, after I removed all the Web proxies, this issue is fixed!

Xcode 7.3 is excruciatingly slow when loading Storyboard IB

I recently upgraded to Xcode 7.3. I found that loading up the storyboard can take anywhere from 5 to 10 minutes to complete(and may sometimes result in a crash). I've restarted my Mac several times. I uninstalled Xcode and reinstalled it to no avail. I then cleared my Derived Data as well as com.apple.dt.Xcode to find that this did not help either. Is anyone experiencing a similar issue and possibly has a solution?
Although this actually might be an issue with incremental changes in Storyboards with Xcode 7.3 you can always speed up build times by creating multiple small Storyboard files in favor of a big bloated Storyboard.
Xcode can then reuse already built Storyboards in subsequent builds (as long as they are not changed) instead of building the complete bloated Storyboard over and over again even for small changes.
Apple even has a guide that might help getting this started.
I hope that helps!
This is really annoying bug/issue with XCode 7.3. So, If you have an hour or so to spend you can download and install XCode 7.3.1 Beta from here https://developer.apple.com/xcode/download/
It seems that this issue has been fixed in this version (at least it works for me).
Edit: OK. After a few minutes, Interface Builder became extremely slow again. Changing only one property can take up to 15-20 minutes.
After some research I have figured out that autolayout constraints were the cause of this issue, BUT only if you have a combination of some components present. I had a segmented control inside a navigation bar. When I removed navigation bar and placed segmented control in a simple UIView, all issues were gone and IB was smooth again.
Hope this will help.
I am using Xcode 7.3.1 and had the same problem. My problem was solved by disabling source control.
Go to Xcode->Preferences->Source Control and then Uncheck the Enable Source Control. Worked for me.
Thanks.
Sometimes the storyboard gets slow because of unresolved errors of autolayout. In my case i tested by changing screensizes and it showed me some errors on different sizes. Once i resolved those errors the storyboard was working fine. Please confirm
Yep I had the same problem. In design mode, it's Autolayout that is causing the 5-10 second delay between edits, especially if it's a large storyboard. Turning off Autolayout in the storyboard at design time fixed the issue for me:
Open project
Select storyboard from the Project Navigator
Open the file inspector
Under Interface Builder Document uncheck 'Use Autolayout'
If you need Autolayout at run time, I recommend you layout your Storyboard in design time with this off (to avoid those long delays between edits) then turn it back on afterwards. Or, turn Auto layout on programatically. Or better yet, split your storyboard out into smaller storyboards.
Referenced this question: Can I disable autolayout for a specific subview at runtime?
I got the same issue recently after I updated the OSX to 10.11. Xcode 7.3 will take almost 5 mintues to respond when I just change the button's font (or anything else change). This made me almost crazy. Incidently, just for a try, I updated Xcode from App Store to 7.3.1. Then I was happy to cry when I opened the storyboard and changed the attributes. Xcode responds smoothly.
So please try Xcode 7.3.1 for your problem. Hopefully you can be happy with it.

How to disable Xcode 5 Source Control from terminal / command line?

I am using Xcode 5.0.2 and yesterday I did nothing special but used its source control function to check out and update from svn.
Today, Xcode continues crashing over and over again when it launches. I googled a solution that is disabling the source control in Xcode's Preference.
But since it crashes when it launches, I don't have change to go into the Preference Panel to do the operations.
So is there command that I can do in Terminal to disable the source control of Xcode?
!!!UPDATE:
actually this is not the real problem I ran into. I thought my Xcode crash because of the source control issue. So I send this post and got an answer quickly. Thanks #zzyclark .
But after I did as the post in the link said, my Xcode still crash. I've used other way and got the problem done.
I am gonna keep this post for the people who really want to disable Xcode source control in Terminal.
But if the admin think this is not the propriety. You could delete this post.
rather than close it in terminal, can u check this. This is used to disable the version control of xcode 4 by modifying the file name extension.Can you disable version control integration in Xcode 4

ibtool failed when compiling storyboard

I just downloaded a project from a git repository on two different Macbooks. On the first, it runs without problem.
On the second Macbook shows me the following message:
Command /Applications/Xcode.app/Contents/Developer/usr/bin/ibtool
failed with exit code 255
When trying to compile the file MainStoryboard.storyboard.
When I click the MainStoryboard.storyboard on XCode, it crashes and doesn't open it.
On the other computer, everything works fine.
I tried the following things to fix this problem, without success:
1) Upgraded XCode from 4.5 to 4.5.2
2) Removed the project directory and cloned the repository again.
3) Deleted the contents of my project on ~/Library/Developer/Xcode/DerivedData
4) purge
Any ideas on how to fix this problem?
Found this issue using XCode 5.
I've solved the issue, but it required a hard reset.
Some said it was because I installed XCode outside of the App Store, or because the simluator was buggy, or because XCode was pointing at the wrong version of the Simulator, or a resoruce was missing a target membership, or whatever. I tried all of that.
I downloaded XCode from the App Store, re-installed the Simulators, and still no luck. So I just rolled back my repository to an earlier date, and lost some work in the process. Not much though, because I always commit little and often.
Since ever starting to use storyboards back in 2011, I have always committed little AND OFTEN. Storyboards are fragile.
EDIT
After adding the new components back in, the problem re-surfaced.
I noticed that I put a static table view, within a UIViewController. I was doing this before.
I was using a subclass of UITableViewController in code, but the storyboard scene, was a UIViewController. I dragged out a UITableViewController instead, and moved the table view cells into that, and it solved the issue.
All thanks to missing error messages. Where have they all gone since XCode 5?
Do a
which ibtool
At the command line on both Macs. Chances are they are different.
Before Xcode was bundled in a single .app bundle it would install command line tools in folders like /usr/local.
I would recommend you remove those local copies to avoid interference with Xcode's built in version, i.e. that it uses the old version. If you still want to be able to use ibtool from the command line, here's an explanation about xcrun: http://www.cocoanetics.com/2012/07/you-dont-need-the-xcode-command-line-tools/
Almost half year later I finally succeeded to discover what was causing this problem and fixed the bug.
Now, with XCode 4.6.3 it gives me another clue about the problem:
2013-06-28 18:15:32.606 Interface Builder Cocoa Touch Tool[7894:f07] CFPreferences: user home directory at file://localhost/Users/[myusername]/Library/Application%20Support/iPhone%20Simulator/User/ is unavailable. User domains will be volatile.Command /Applications/Xcode.app/Contents/Developer/usr/bin/ibtool failed with exit code 255
After receiving this new message, I searched for this User folder inside "iPhone Simulator" and there were no folder named "User".
I created the "User" folder, did a clean and after this I was able to build the project again!
the fix for me in Xcode 6.4 was to ... restart my computer. sad, but true.
I was getting the same error. It turned out I had miswired some of the outlets in the tableview cell.
I don't know if someone is still struggling with this error but today was my turn to confront it. I just solved it. This is the context:
I had a UITableViewCell with half of it cover by a simple UIVIEW. Inside this UIVIEW i had many other view (UILables, UITextField, etc etc)
Just where the UIVIEW ended (Again it covered the middle of the entire UITableViewCell) i placed an UIImageView. Half of the UIImageView covered the UIView and the other half was on the UITableView itself. In the Hierarchy the UIImageView was on the UITableVIewCell and not inside the UIView.
The problem was when i was applying autolayout i put a constraint between a view inside the UIView and the UIImageView that was outside of the UIVIEW.
When i run the app, the error came up. After half an hour deleting views and stuff i realized that the error was caused by that constraint. After deleting that constraint, the error was gone.
So bottom line, check your constraints! only "Connect" views with others that are inside the same superView.
Good luck!
Try completely reinstalling Xcode. Seems like there's something wrong with ibtool that a reinstall is probably able to fix.

Xcode 4.4 keeps crashing

Every time I open my app in Xcode 4.4 it crashes. It never used to do this in Lion and being very close to submission after about 6 months of work, I'm pretty annoyed to say the least!
This is part of the crash report if it helps; I can't make head nor tail of it. If anybody can help me, I'd be forever in your debt.
UNCAUGHT EXCEPTION (NSBadBitmapParametersException): Overflow allocating bitmap backing store. Cannot back bitmap with 1152921504606846976 bytes per row, -9223372036854775808 height, and 1 planes.
Um, have had that issue what I did Is delated xcode and redownloaded it.
Hope that works!
Experiencing such kind of problems, I got the following conclusion: 3 files can be corrupted
Your project file, in that case try using time machine to get the
one which will work
The XCode prefs: /Users/xample/Library/Preferences/com.apple.dt.Xcode.plist
Your project's Derived data ~/Library/Developer/Xcode/DerivedData
If one of those is corrupted, it will corrupt the 2 other one. To recover a project, start trashing the pref and derived data, then try to open your project. Reinstalling XCode did not solved my problem, using the DP4.5 neither in my case.
HOWEVER: Installing the latest "Command Line Tools for Xcode solved it (and this is probably the first thing to try)
Sounds weird but Xcode 4.4 has problem with printing out logs of big strings.
I had the same problem, and I deleted an NSLog which printed a big amount of text, and the crash stopped...
For me, I'm getting this crash when trying to open a particular .storyboard file from the project view. If I open the file directly through finder, it doesn't immediately crash so long as the window is small. If I try to resize it or scroll one of the views into view, it will crash again.
I faced same issue with XCode 4.5.1. It keep crashing whenever i open storyboard and it throws following error:
Application Specific Information:
ProductBuildVersion: 4G1004
UNCAUGHT EXCEPTION (NSBadBitmapParametersException): Overflow allocating bitmap backing store. Cannot back bitmap with 1152921504606846976 bytes per row, -9223372036854775808 height, and 1 planes.
Apple released new developer preview version of XCode 4.5.2 last week, which has fix for all intermediate crashes that we saw in previous versions. This build is available in https://developer.apple.com/devcenter/ios/index.action
You can try this.
This is going to Apple as a bug report I'm afraid; they said from the crash report that it looks like a bug. Thanks to everyone for their help.

Resources