2016-09-21 9 views
15

Podczas budowania aplikacji poprzez XCode 8, uruchamiając aplikację na Mavericks (OSX 10.9), otrzymuję awarię z powodu następującego błędu:tokenCount <maxCountIncludingZeroTerminator twierdzenie (OSX 10.9)

Crash stack

Jabłko robi specjalnie Wspominam o tym w XCode 8 Release notes z następującymi szczegółami:

Asset Catalogs

Applications compiled with Xcode 8 and a deployment target of iOS 7 may crash at launch with the following assertion:

Assertion failed: (maxCountIncludingZeroTerminator > 0 && tokenCount < maxCountIncludingZeroTerminator), function CUIRenditionKeyCopy, file /SourceCache/CoreUI/CoreUI-232.4/CoreTheme/ThemeStorage/CUIThemeRendition.m, line 185.

To work around this issue, update the deployment target to iOS 8.0 or higher, or add a single image to the asset catalog that has at least five attributes specified across the image set, such as:

  • scale (1x, 2x, 3x)
  • idiom (add iPad,iPhone, and a universal asset)
  • direction (left to right, right to left)
  • width/height class (any & compact, and so forth)
  • memory (add a 1 GB asset)
  • graphics (add a Metal 1v2 asset)

It is not necessary to use the image in your code or to add all of these attributes. (27852391)

próbowałem dodając kilka 3x skalowanych obrazków do projektu, jednak wciąż pojawia się ten sam wyjątek. Zgodnie z dokumentacją muszę tylko dodać jeden z tych atrybutów, aby rozwiązać problem, ale nie wydaje mi się, że to mi wystarczy. Czy ktoś w to wbiegł? Czy ktoś ma jakieś rozwiązanie?

+2

Musisz wybrać co najmniej pięć z tych atrybutów. – JustSid

Odpowiedz

15

stworzyłem nową ikonę i ręcznie modyfikować plik json zawierać następujące elementy:

{ 
    "images" : [ 
    { 
     "idiom" : "universal", 
     "filename" : "apple-17.png", 
     "language-direction" : "right-to-left", 
     "scale" : "1x" 
    }, 
    { 
     "idiom" : "universal", 
     "filename" : "apple-18.png", 
     "graphics-feature-set" : "metal1v2", 
     "language-direction" : "right-to-left", 
     "scale" : "1x" 
    }, 
    { 
     "idiom" : "universal", 
     "filename" : "apple-39.png", 
     "language-direction" : "right-to-left", 
     "scale" : "2x" 
    }, 
    { 
     "idiom" : "universal", 
     "filename" : "apple-38.png", 
     "graphics-feature-set" : "metal1v2", 
     "language-direction" : "right-to-left", 
     "scale" : "2x" 
    }, 
    { 
     "idiom" : "universal", 
     "filename" : "apple-48.png", 
     "language-direction" : "right-to-left", 
     "scale" : "3x" 
    }, 
    { 
     "idiom" : "universal", 
     "filename" : "apple-49.png", 
     "graphics-feature-set" : "metal1v2", 
     "language-direction" : "right-to-left", 
     "scale" : "3x" 
    }, 
    { 
     "idiom" : "universal", 
     "filename" : "apple-19.png", 
     "language-direction" : "right-to-left", 
     "height-class" : "regular", 
     "scale" : "1x" 
    }, 
    { 
     "idiom" : "universal", 
     "filename" : "apple-20.png", 
     "graphics-feature-set" : "metal1v2", 
     "language-direction" : "right-to-left", 
     "height-class" : "regular", 
     "scale" : "1x" 
    }, 
    { 
     "idiom" : "universal", 
     "filename" : "apple-37.png", 
     "language-direction" : "right-to-left", 
     "height-class" : "regular", 
     "scale" : "2x" 
    }, 
    { 
     "idiom" : "universal", 
     "filename" : "apple-36.png", 
     "graphics-feature-set" : "metal1v2", 
     "language-direction" : "right-to-left", 
     "height-class" : "regular", 
     "scale" : "2x" 
    }, 
    { 
     "idiom" : "universal", 
     "filename" : "apple-50.png", 
     "language-direction" : "right-to-left", 
     "height-class" : "regular", 
     "scale" : "3x" 
    }, 
    { 
     "idiom" : "universal", 
     "filename" : "apple-51.png", 
     "graphics-feature-set" : "metal1v2", 
     "language-direction" : "right-to-left", 
     "height-class" : "regular", 
     "scale" : "3x" 
    }, 
    { 
     "idiom" : "universal", 
     "filename" : "apple-21.png", 
     "width-class" : "regular", 
     "language-direction" : "right-to-left", 
     "scale" : "1x" 
    }, 
    { 
     "idiom" : "universal", 
     "filename" : "apple-22.png", 
     "width-class" : "regular", 
     "graphics-feature-set" : "metal1v2", 
     "language-direction" : "right-to-left", 
     "scale" : "1x" 
    }, 
    { 
     "idiom" : "universal", 
     "filename" : "apple-35.png", 
     "width-class" : "regular", 
     "language-direction" : "right-to-left", 
     "scale" : "2x" 
    }, 
    { 
     "idiom" : "universal", 
     "filename" : "apple-34.png", 
     "width-class" : "regular", 
     "graphics-feature-set" : "metal1v2", 
     "language-direction" : "right-to-left", 
     "scale" : "2x" 
    }, 
    { 
     "idiom" : "universal", 
     "filename" : "apple-52.png", 
     "width-class" : "regular", 
     "language-direction" : "right-to-left", 
     "scale" : "3x" 
    }, 
    { 
     "idiom" : "universal", 
     "filename" : "apple-53.png", 
     "width-class" : "regular", 
     "graphics-feature-set" : "metal1v2", 
     "language-direction" : "right-to-left", 
     "scale" : "3x" 
    }, 
    { 
     "idiom" : "universal", 
     "filename" : "apple-23.png", 
     "width-class" : "regular", 
     "language-direction" : "right-to-left", 
     "height-class" : "regular", 
     "scale" : "1x" 
    }, 
    { 
     "language-direction" : "right-to-left", 
     "graphics-feature-set" : "metal1v2", 
     "idiom" : "universal", 
     "width-class" : "regular", 
     "filename" : "apple-16.png", 
     "height-class" : "regular", 
     "scale" : "1x" 
    }, 
    { 
     "idiom" : "universal", 
     "filename" : "apple-33.png", 
     "width-class" : "regular", 
     "language-direction" : "right-to-left", 
     "height-class" : "regular", 
     "scale" : "2x" 
    }, 
    { 
     "language-direction" : "right-to-left", 
     "graphics-feature-set" : "metal1v2", 
     "idiom" : "universal", 
     "width-class" : "regular", 
     "filename" : "apple-32.png", 
     "height-class" : "regular", 
     "scale" : "2x" 
    }, 
    { 
     "idiom" : "universal", 
     "filename" : "apple-54.png", 
     "width-class" : "regular", 
     "language-direction" : "right-to-left", 
     "height-class" : "regular", 
     "scale" : "3x" 
    }, 
    { 
     "language-direction" : "right-to-left", 
     "graphics-feature-set" : "metal1v2", 
     "idiom" : "universal", 
     "width-class" : "regular", 
     "filename" : "apple-55.png", 
     "height-class" : "regular", 
     "scale" : "3x" 
    } 
    ], 
    "info" : { 
    "version" : 1, 
    "author" : "xcode" 
    } 
} 

nie faktycznie używać tej ikony w dowolnym miejscu. To rozwiązało problem. Przesłałem ikonę here, jeśli ktoś napotka na ten problem i potrzebuje go.

+0

Dziękuję bardzo za opublikowanie tego pytania i rozwiązania. – DDP

+0

Podążyłem za tym rozwiązaniem, ale nadal zawiesza się Asercja nie powiodła się: (tokenCount mKane

+0

Spróbuj ponownie pobrać plik iconFix.zip. Właśnie zrobiłem aktualizację i moją oryginalną odpowiedź. – Kyle

3

W moich testach (również ukierunkowanych na macOS 10.9) wystąpiło to tylko podczas budowania z Xcode 8 na macOS 10.12.

Awaria podczas uruchamiania nie wystąpiła podczas budowania z Xcode 8 na macOS 10.11.6.

Może to być szybkie obejście dla niektórych osób, chociaż odpowiedź Kyle'a jest ostateczna zgodnie z informacjami o wydaniu Xcode. (Nie testowałem Xcode 8.1beta).

Aktualizacja

Budynek z Xcode 8.1b2 na MacOS 10.12, zachowanie jest takie samo jak z Xcode 8.0. (Następny test będzie oparty na wersji beta 10.12.1)

+0

Miałem ten sam problem, zaktualizowałem swoje aplikacje dla Touchbar, a teraz wszystkie one się zawieszają w dniu 10.12.1 Rozwiązanie Kyle'a wydaje się działać do tej pory. – Tibidabo