IOS project showing error "An internal error occurred. Editing functionality may be limited" on xcode 7.1

IosXcodeCordovaXibxcode7.1

Ios Problem Overview


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.

enter image description here

Ios Solutions


Solution 1 - Ios

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.

Solution 2 - Ios

Try this, it's work for me,

Updated NOTE: Mostly this error occurred when you have open 2 different version of Xcode at same time.

Solution: Please close both Xcode and clear derived data.now again try, use one Xcode at a time.

OR

Follow below mention steps ,

  1. Trash derived data by two ways either by command or Preferences.

    rm -rf ~/Library/Developer/Xcode/DerivedData/

OR

Xcode---> Preferences--->Location--->Derived Data

derived data

  1. In Xcode menu go to product clear the project.

enter image description here

  1. Disconnect connected device and restart Xcode and system .

enter image description here

follow above steps error will remove.

Hope it's helpful for some one.

Solution 3 - Ios

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 came up:
    > Command failed due to signal: Segmentation fault: 11

  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!

Solution 4 - Ios

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.

Solution 5 - Ios

Close project from File menu and Reopen the project again, the issue is gone.

Solution 6 - Ios

Mine caused from creating a bad constraint so I fixed the constraint and everything is working now.

Solution 7 - Ios

I was getting this error on Xcode 11.4. I tried all of the above suggestions and none of them worked. I am posting my fix in case it will help someone else. I was using the legacy build system for my project since I had options that were not yet supported with the latest build system. Xcode 11.4 now supports those options. I the value for BuildSystemType to Latest in all of WorkspaceSettings.xcsettings files and then this error went away.

	<key>BuildSystemType</key>
	<string>Latest</string>

Solution 8 - Ios

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.

Solution 9 - Ios

I have deleted XCode 7.1 and installed XCode 7.0.1.

http://developer.apple.com/devcenter/download.action?path=/Developer_Tools/Xcode_7.0.1/Xcode_7.0.1.dmg

This solved the problem.

Solution 10 - Ios

I updated XCode to 7.1.1 and this resolved the issue.

Solution 11 - Ios

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.

Solution 12 - Ios

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.

Solution 13 - Ios

Xcode 7.3.1

In my case, the error was caused by the following line:

print("|" + board[x][y])

Changed to:

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.

Solution 14 - Ios

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.

Solution 15 - Ios

As for me problem was in ternary operator (single line if statement). Version 7.3.1

Solution 16 - Ios

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

Solution 17 - Ios

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.

Solution 18 - Ios

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 NSAttributedString in Swift 3.1

Solution 19 - Ios

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).

Solution 20 - Ios

from my side, its RAM issue. I have remove others application.Then it works normally.

Solution 21 - Ios

This happened to me in Xcode 10.2, while editing .xib file. Trying to clear de derived data didn't help me. What solved the problem was change the device for prototyping in the interface builder, it forced the IB to render again and solved the problem. enter image description here

Solution 22 - Ios

Also happens when you declare non-swift/wrong data types like Long, boolean etc. So stupid.

Solution 23 - Ios

Super specific but one of compile-time errors that can cause this is putting the keyword 'optional' before a function in a non-objc protocol.

Solution 24 - Ios

It happened to me because I copied buttons from old XIB files to the storyboard. So i deleted the buttons, and all is ok. I am guessing apple added some non compatible button XMLs in the new storyboard.

Solution 25 - Ios

I had this problem yesterday, and after some digging, I solved the problem which was very stupid in my case. I discovered that I put an environment object inside a class function, like this:

class SomeHelpers {
    static func someFunc(_ value: Bool) {
        @EnvironmentObject var userData: UserData // << HERE
    }
}

I removed that line, and the strange error gone away.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionArjun T RajView Question on Stackoverflow
Solution 1 - IosjithinView Answer on Stackoverflow
Solution 2 - IosJaywant KhedkarView Answer on Stackoverflow
Solution 3 - IosRyan CocuzzoView Answer on Stackoverflow
Solution 4 - IosZiggySTView Answer on Stackoverflow
Solution 5 - IosChris HoView Answer on Stackoverflow
Solution 6 - IosAhmadrezaView Answer on Stackoverflow
Solution 7 - IosStephen JohnsonView Answer on Stackoverflow
Solution 8 - IosCaroline ForemanView Answer on Stackoverflow
Solution 9 - IosДмитрий ПучкаView Answer on Stackoverflow
Solution 10 - IosGeekoderView Answer on Stackoverflow
Solution 11 - IosAlvin GeorgeView Answer on Stackoverflow
Solution 12 - IosHristo AtanasovView Answer on Stackoverflow
Solution 13 - IosAlex UrecheView Answer on Stackoverflow
Solution 14 - IosJase68View Answer on Stackoverflow
Solution 15 - IosCheView Answer on Stackoverflow
Solution 16 - IosMichael JamesView Answer on Stackoverflow
Solution 17 - IosTheeBenView Answer on Stackoverflow
Solution 18 - Iosu.genView Answer on Stackoverflow
Solution 19 - IosJeremy Huddleston SequoiaView Answer on Stackoverflow
Solution 20 - IosZahedView Answer on Stackoverflow
Solution 21 - IosHugo JordaoView Answer on Stackoverflow
Solution 22 - Iosrajeswari ratalaView Answer on Stackoverflow
Solution 23 - IosLogan GeorgeView Answer on Stackoverflow
Solution 24 - IosGeneCodeView Answer on Stackoverflow
Solution 25 - IosSami AlmalkiView Answer on Stackoverflow