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

28

80

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

Gant answered 31/10, 2015 at 20:44 Comment(18)
Same problem here. Wish someone give a brief explanation about it.Brookbrooke
@Brookbrooke i tried lots of solutions but :( , now i installed xcode 6.1 again.Gant
Don't be impatient my friend. There should be some answer for it. :)Brookbrooke
@Brookbrooke any workaround for this?Gant
@Brookbrooke just try product--->archive , and its working fine then i took build then i got forum.ionicframework.com/t/… error, so i applied that fix and now its running on simulator am not sure about this fix just try onceGant
Its not just for cordova. I am experiencing this with a native iOS project.Monopode
@somexyz hi just try product--->archive and chek once , and check all deployment targets also..Gant
That solution on the Ionic forum worked for meWeighted
@Arjun T Raj I don't know how or why, the error is not showing anymore. I just restarted my xcode. That's it. :/Brookbrooke
I wish there were a way in Xcode to at least disable the msg bar that auto shows and hides, it happens so often I can't type in a straight line!Jola
I don't care about the lousy message but rather would like to turn it off since it jump shifts the edit text by one line which is extremely confusing.Golf
What worked for me (not related to Cordova) was to comment-out the source code I'd just copied into the project. The error went away. Then I could reduce the amount of code I'd commented out little by little until I got a "real" error message that made me realize what was wrong with the code I'd added.Italianism
i'm facing same issue on Xcode 9.0 . Need help. tried all of below solutions but not work any of themSavdeep
@AdnanMajeed its working fine without any fix (xcode 8+)Gant
@ArjunTRaj Bro i never face this issue on Xcode 7 or 8. now i'm facing first time this issue on Xcode 9.0. :( And i've tried all the solutions below mention. but no work.Savdeep
@AdnanMajeed till now i don't know the actual solution or fix.Gant
Xcode 9 the same problemZebu
Apple continue make animoji when the main soft for dev program with thousand bugsZebu
S
36

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.
Schrock answered 18/4, 2016 at 10:29 Comment(3)
Worked for me--just to clarify, you just need to delete all the files in this folder, not the folder itself. (Maybe Xcode will recreate the folder if you delete it, but it's probably safer not to.)Pyles
Side note: Before removing the DerivedData folder, Xcode must be entirely closed.Nonresistance
@JamesToomey no there's no risk implication. You can delete the folder and Xcode will recreate immediately and empty.Enforcement
S
27

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

2) In Xcode menu go to product clear the project.

enter image description here

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

Sukin answered 19/5, 2016 at 12:21 Comment(0)
P
13

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!
Prime answered 12/7, 2016 at 16:49 Comment(2)
This works when you dont have 10.000 lines of codes, multiple targets or cocoapods dependencies I guess. I am gonna go crazy because of this error.Dentistry
Tried a similar process too, it worked, but then, anytime I type in any wrong code, it immediately gives me the "Command failed due to signal: Segmentation fault: 11" and "an internal error..." and it drove me nuts. Deleting derived data and re-adding my linked libraries worked afterwards thoughFormyl
M
8

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.

Meekins answered 8/4, 2016 at 10:28 Comment(0)
P
6

Just to add to the mix. This started to happen to me out of sudden with Xcode 14.0. There was also "Report a bug" button on the top-right. Clicking on the button created a folder with the bug report and in the log.txt file there there was a reference to IBAgent failure and iPhone SE simulator - the one used for the preview in the interface builder.

Looks like the IBAgent process crashed at some earlier point. I had no idea how to restart this particular process. Cleaning derived data folder & restarting Xcode were not helping.

The whole mac restart fixed the issue. IBAgent is running and opening that same storyboard with no problem.

Reported/Submitted to Apple.

Positivism answered 14/9, 2022 at 16:44 Comment(1)
Happened for me in Xcode 15.3 immediately after updating an iOS project to require a minimum iOS version of 16 (was 11 previously). Restarting Xcode did not fix the problem. Rebooting my Mac as suggested in this answer DID fix the problem.Bisectrix
I
2

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

Inerasable answered 20/4, 2016 at 2:15 Comment(0)
M
2

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

Morula answered 31/12, 2019 at 11:48 Comment(0)
G
1

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

Genesisgenet answered 15/4, 2018 at 9:57 Comment(0)
L
1

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>
Laughton answered 14/4, 2020 at 23:47 Comment(0)
H
0

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.

Hussy answered 2/11, 2015 at 15:30 Comment(0)
B
0

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.

Bigford answered 5/11, 2015 at 13:4 Comment(1)
just try this fix for 7.1 forum.ionicframework.com/t/…Gant
C
0

I updated XCode to 7.1.1 and this resolved the issue.

Czerny answered 1/12, 2015 at 8:2 Comment(5)
I have 7.1.1. and I have still this issue.Giusto
1) If you are directly opening the project, make sure you are opening in XCode 7.1.1. I have multiple XCode installed so I set XCode7.1.1 as default. 2) Clean All Target and run again. Also try to delete the module cache and build folder.Czerny
I have Xcode 7.3 and I have the same issue. Do anyone found a solution for this problem ?Golfer
Why the -1? It solved for me. Just one of the answers.Czerny
Xcode 7.3.1 and the issue still exists... It is dependent on your exact source code though I suspect.Jola
T
0

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.

Tran answered 4/4, 2016 at 9:30 Comment(0)
C
0

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.

Cordiecordier answered 20/4, 2016 at 13:44 Comment(1)
In some cases could be an error in other files except AppDell too. In order to find the problematic piece of code quicker, try commenting the last edited/written code before the problem has occurred .. :)Cordiecordier
G
0

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.

Gatian answered 8/5, 2016 at 21:28 Comment(0)
N
0

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.

Newel answered 2/8, 2016 at 14:29 Comment(0)
J
0

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

Jemena answered 12/8, 2016 at 16:1 Comment(0)
P
0

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
Partisan answered 4/9, 2016 at 20:14 Comment(1)
Values from a dictionary are always returned as optionals, in case you request a key that isn't in it.Bowstring
S
0

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.

Specular answered 20/10, 2016 at 7:20 Comment(0)
D
0

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

Dentistry answered 19/5, 2017 at 21:33 Comment(0)
B
0

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).
Binford answered 31/10, 2017 at 18:47 Comment(0)
S
0

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

Sarina answered 24/7, 2019 at 16:59 Comment(0)
B
0

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

Berfield answered 16/7, 2020 at 8:16 Comment(0)
A
0

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.

Ac answered 16/9, 2020 at 21:49 Comment(0)
E
0

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.

Emotionality answered 26/12, 2020 at 3:42 Comment(0)
S
0

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.

Snead answered 13/9, 2021 at 23:51 Comment(0)
K
0

I solved this problem on XCode 13.4 by disconnecting the device (iPhone) and restarting XCode. Before that I tried to clean Derived Data and Build Folder - didn't help.

Knuth answered 1/7, 2022 at 9:53 Comment(0)
A
0

Jan 2023, Xcode 14 - this error still happening. I was able to get off easy: clean, file, exit Xcode, reboot MBP. Went away.

Annelid answered 10/1, 2023 at 17:29 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.