Playgrounds crash with an “unknown error” when using Swift XML parsing

I am developing a custom structure that includes some XML parsing using Kanna . Whenever I try to import my framework into a playground, the playground crashes with the following error:

Playground execution failed: expression failed to parse, unknown error
* thread #1: tid = 0x4e9448, 0x00000001074bf360 com.apple.dt.Xcode.PlaygroundStub-macosx`executePlayground, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
  * frame #0: 0x00000001074bf360 com.apple.dt.Xcode.PlaygroundStub-macosx`executePlayground
    frame #1: 0x00000001074bd22a com.apple.dt.Xcode.PlaygroundStub-macosx`-[PlaygroundViewBridgeService execute] + 90
    frame #2: 0x00007fffb4fc03ec CoreFoundation`__invoking___ + 140
    frame #3: 0x00007fffb4fc0271 CoreFoundation`-[NSInvocation invoke] + 289
    frame #4: 0x00007fffb4fd97a6 CoreFoundation`-[NSInvocation invokeWithTarget:] + 54
    frame #5: 0x00007fffc86ca95b ViewBridge`__68-[NSVB_ViewServiceImplicitAnimationDecodingProxy forwardInvocation:]_block_invoke + 47
    frame #6: 0x00007fffc86e9f4c ViewBridge`__runAnimationGroup_block_invoke + 21
...

The framework I'm developing works fine (it builds, and unit tests work as expected), but it's a pain not to use it on the playground.

I gave an example project with instructions for replicating the problem, as well as a full stack trace on GitHub: https://github.com/noahcgreen/XMLTest . If it import Kannais removed from the source XMLTest.swift file, the error disappears.

So far I have tried:

  • using fuzi instead of kanna ,
  • installation with CocoaPods instead of Carthage,
  • updating libxml2 on my device (using Homebrew) and
  • starting from another (and new) device with a clean Xcode installation,

all is unsuccessful. I am here. What am I doing wrong?

+4
source share
1 answer

Good for your user structure, first you need to make the workspace a playground

  • "" > " "

  • → .

apple

: :

, .

.

iOS-, 64- .

, .

Objective-C, Defines Module (DEFINES_MODULE), Yes.

http://help.apple.com/xcode/mac/8.2/#/devc9b33111c . , .

Edit:

#import <Cocoa/Cocoa.h>
#import <Kanna/Kanna.h>


//! Project version number for XMLTest.
FOUNDATION_EXPORT double XMLTestVersionNumber;

//! Project version string for XMLTest.
FOUNDATION_EXPORT const unsigned char XMLTestVersionString[];

// In this header, you should import all the public headers of your framework using statements like #import <XMLTest/PublicHeader.h>

ok xmltest.h

+1

Source: https://habr.com/ru/post/1666924/


All Articles