0

I have a project that must support iOS 7, so I had Xcode 7.3.1 and the latest Xcode 8 installed.

Things were mostly fine. But now, all of the sudden, when I build my project and run it on iOS7, the app crashes during startup.

My colleague never had Xcode 8 installed. When they build the same source (with git repository) on the same device, everything works perfectly fine.

The app fails when it tries to access the view property of a view controller. That looks like this.

MyViewController *myViewCon = [[MyViewController alloc] initWithNibName:NSStringFromClass([MyViewController class]) bundle:[NSBundle mainBundle]];

// Access the view property
UIView *view = [myViewCon view]; // CRASH HERE

Here's the error I get:

Assertion failed: (tokenCount < maxCountIncludingZeroTerminator - 1), function CUIRenditionKeySetValueForAttribute, file /SourceCache/CoreUI/CoreUI-232.4/CoreTheme/ThemeStorage/CUIThemeRendition.m, line 136.

What I've tried

Deleting both versions of Xcode and removing all files listed here: How to Completely Uninstall Xcode and Clear All Settings

Then reinstalling only version 7.3.1.

Plus a full clean of the build folder.

I don't know what else to do.

Community
  • 1
  • 1
ABeard89
  • 911
  • 9
  • 17

1 Answers1

0

What could cause that is that your xib are set to be opened only from XCode 8, and this added some info/structure in the XML that are not the same as before, and could explain the crash.

To fix that:

  1. Open your .xib file with XCode 8
  2. Select File Inspector: enter image description here
  3. Select Opens In:
    enter image description here
  4. Allows it to opens with XCode 7.x:
    enter image description here
Larme
  • 24,190
  • 6
  • 51
  • 81
  • I thought of this. My coworker is able to build and run the same source from git using Xcode 7.1.3. So this can't be it. Just to be sure, I checked, and it's set to open in Xcode 7. – ABeard89 Apr 19 '17 at 10:13
  • That's new info. Could you confirm that you have the same version of OSX? – Larme Apr 19 '17 at 10:16
  • I wrote it in the original post, but I guess it was easy to miss. We're running different versions of OSX, but I was able to build and run before on this version of OSX. It just broke today. – ABeard89 Apr 19 '17 at 10:18
  • For reference I'm running Sierra, they're running El Capitan. – ABeard89 Apr 19 '17 at 10:24