I just created one new cordova ios project via CLI, and i opened that project in Xcode 7.1 and while running on simulator am getting some error on mainViewController.xib, if we clicked on that error its showing xib file and on top of that showing one warning message "An internal error occurred. Editing functionality may be limited" . So am unable to run this project.
I don't know whether this is due to Xcode bug or cordova bug or any other settings issue in my Xcode.
I had this issue and clearing derived data folder fixed the issue for me
Preferences > Locations > Derived Data > click the arrow to open in Finder > trash it.
Try this, it's work for me follow simple steps :-
Follow below mention steps ,
1) Trash derived data by two ways either by command or Preferences.
rm -rf ~/Library/Developer/Xcode/DerivedData/
Xcode---> Preferences--->Location--->Derived Data
2) In Xcode menu go to product clear the project.
3) Disconnect connected device and restart Xcode and system .
follow above steps error will remove.
Hope it's helpful for some one.
I'm in Xcode 7.3 and had the same issue after opening file in xCode 8.0. This worked for me:
Made a product/clean in Xcode, then quit Xcode and clean out all the content in ~/Library/Developer/Xcode/DerivedData manually.
Fixed the problem in my program, hope this can help someone!
So, this is the process of my fix:
1. Could not figure out why I was getting this issue, when everything had been working fine. 2. I tried the following: Cleaning project Deleting DerivedData Creating new, identical View Controllers to see if the issue was just in those particular views.(the same issue occurred) Deleting and Reinstalling Xcode Restarting my Computer. Asking on StackOverflow. (Finally) Submitting a TSI, which got redirected to Apple Bug Reporter. 3. I made a new swift file for the View Controller that was having the issue, and it compiled, showing that is was not an issue with the View Controller itself. 4. I started getting an error: "Command failed due to signal: Segmentation fault: 11" (on the file associated with the View that did not work), which is really ambiguous. This error looks as if it would be an error occurring in a segue (jumping from one View Controller to another) but the code itself would not compile. After digging into the error, I realized the code stopped compiling at that swift file. 5. So, I copy-pasted the code from the swift file (the one causing problems) into the Notes application and I deleted the swift file from the Application. 6. Little by little, I started taking code from the file that did not work (in Notes) and putting it into the file that did work until the error: "Command failed due to signal: Segmentation fault: 11" came up. When it did, 7. I started commenting out snippets of the code to isolate the error. 8. After finding the error line, I realized it was just an error that caused all of these issues. A simple fix that the debugger did not recognize as a routine error. So, I fixed it and it works!
And for those of you less inclined to read :) ...
Summary of what your problem may be:
- Compile-time error in your code that is not recognized by the Xcode debugger!
Close project from File menu and Reopen the project again, the issue is gone.
I updated XCode to 7.1.1 and this resolved the issue.
I changed Xcode - Preferences - Text Editing, ticked on 'Code Folding Ribbon' and 'Focus code blocks on hover'.
Cleaned the project and it removed the source editing error.
Yesterday I had this problem too. I remember I've had it before 1 year too and I remember how to fix it. The reason for the error (in my case) was an error in the code in AppDelegate. Sometimes errors in AppDelegate are the reason for this behaviour of xCode. So if You want to fix it, first try commenting Your code in AppDelegate function by function, until you find the function with the error. Once you find it start uncommenting piece by piece the code in that particular function until you see which code line is breaking everything. Believe me ... This will save you lots of time searching the internet.
In my case, the error was caused by the following line:
print("|" + board[x][y])
After that, I did a Product -> Clean (Command+Shift+K) That fixed the issue.
PS: board[x][y] is a [[Character]], if that matters. I copy-pasted my Java Class into Xcode to edit it into Swift.
Running Xcode 7.3.1, I had the same error message appear while editing a .xib file. Performance would stall, and Xcode often became unresponsive. Filed a bug report, and in the meantime came across this line of code in the .m file associated with the most problematic .xib:
NSString *check = [formatter stringFromDate:date];/
The "/" was not being flagged as an error, and the project had built and run many times with this in place. After removing the "/", performance improved dramatically, and the error message has only appeared a couple of times, briefly, since then and by now not for several days.
So far, this seems to be a case of a glitch in the debugger.
As for me problem was in ternary operator (single line if statement). Version 7.3.1
FWIW, here's what fixed this for me:
I was performing an operation on a value in a dictionary:
_outcomes[key] *= multiplier
I didn't realize that Swift would treat the value as an optional even though the dictionary is not an optional in this class.
changing to the following worked:
_outcomes[key]! *= multiplier
I just had this issue today and it really got me frustrated for awhile. First I got the error "unable to boot the simulator" and I couldn't load the simulator and then my storyboard started doing this and I got an internal error.
I tried the other solutions mentioned here including cleaning and rebuilding, deleting the DerivedData folder but none worked. I upgraded my OS to Sierra and that solved the problem for me.
Hope it helps.
This has been happening to me on Swift 3.1, Xcode 8.3.2 for a month, I was coding okay, But it came to a point that all the text was only plain text, no colours, no auto complete, no indent. What a torture.....
Xcode was showing an error for
NSAttributedString, but it was compiling fine, I could even see the underlined button in the app no problem. When I removed this code xcode went back to normal. How strange.
Took me days to figure out. I checked out every single commit from github until I found a version of my project that doesnt throw An internal error occurred. Source editor functionality is limited. error.
Then I compared the commit versions and I figured this started to happen when I edited UIButton text thru the code.
Error caused because of
NSAttributedString I wanted to underline to the button text as following
let titleAttributes:[String : Any] = [NSForegroundColorAttributeName : Constants.forgotPassColor, NSUnderlineStyleAttributeName : NSUnderlineStyle.styleSingle.rawValue] let localizedForgotPass = NSLocalizedString("forgotPassword", tableName: "Localizable", comment: "forgot button text") let titleString = NSAttributedString(string: localizedForgotPass, attributes: titleAttributes) forgetPasswordButton.setAttributedTitle(titleString, for: .normal)
Removing this solved the problem. There is something wrong with
Unfortunately, this error is pretty generic and doesn't point to an actual cause. If you look at the error report generated by Xcode, you might be able to get more context to figure out what is going on.
Common causes include:
- Incorrect permissions / ownership set on files.
- Manually deleting files in ~/Library/Developer.
- Installing buggy 3rd party kexts (especially security or firewall software).
I have the same problem. The only way I have found to get round this is to update the target 'Deployment Target' to 8.1 and also the CordovaLib project 'Deployment Target' to 8.1 this allows the app to build and run without the MainViewController error. However this is not a great solution as I assume it no longer supports devices with ios 7.1 installed.