Crash on startup using Xcode 5.1.1 or Xcode6-Beta5

Post here your questions about the Objective-C API for SFS2X

Moderators: Lapo, Bax

Zammy
Posts: 29
Joined: 05 Aug 2014, 16:37

Crash on startup using Xcode 5.1.1 or Xcode6-Beta5

Postby Zammy » 06 Aug 2014, 09:53

I tried to integrate SFS2X with Swift and I was getting this crash on startup. I guessed it is something with iOS8 SDK. Same thing is happening with iOS 7.1 SDK with Objective-C. Some clues will be appreciated.

I saw this viewtopic.php?t=9773 But it leads to missing symbols in link time.

Log:

2014-08-06 11:30:07.338 Test2[8585:60b] Cannot find executable for CFBundle 0x8c614b0 </Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.1.sdk/System/Library/AccessibilityBundles/CertUIFramework.axbundle> (not loaded)
2014-08-06 11:30:07.425 Test2[8585:60b] +[NSStream getStreamsToHostNamed:port:inputStream:outputStream:]: unrecognized selector sent to class 0x1e882b0
2014-08-06 11:30:07.430 Test2[8585:60b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[NSStream getStreamsToHostNamed:port:inputStream:outputStream:]: unrecognized selector sent to class 0x1e882b0'
*** First throw call stack:
(
0 CoreFoundation 0x01d431e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x01ac28e5 objc_exception_throw + 44
2 CoreFoundation 0x01de00e3 +[NSObject(NSObject) doesNotRecognizeSelector:] + 275
3 CoreFoundation 0x01d3350b ___forwarding___ + 1019
4 CoreFoundation 0x01d330ee _CF_forwarding_prep_0 + 14
5 Test2 0x0000742b main + 19691
6 Test2 0x0002ae0b CreateDispatchTimer + 93085
7 Test2 0x0002aa74 CreateDispatchTimer + 92166
8 Test2 0x00009ac1 main + 29569
9 Test2 0x0002af1d CreateDispatchTimer + 93359
10 Test2 0x00002206 -[AppDelegate application:didFinishLaunchingWithOptions:] + 278
11 UIKit 0x006be14f -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 309
12 UIKit 0x006beaa1 -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1810
13 UIKit 0x006c3667 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 824
14 UIKit 0x006d7f92 -[UIApplication handleEvent:withNewEvent:] + 3517
15 UIKit 0x006d8555 -[UIApplication sendEvent:] + 85
16 UIKit 0x006c5250 _UIApplicationHandleEvent + 683
17 GraphicsServices 0x0385af02 _PurpleEventCallback + 776
18 GraphicsServices 0x0385aa0d PurpleEventCallback + 46
19 CoreFoundation 0x01cbeca5 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 53
20 CoreFoundation 0x01cbe9db __CFRunLoopDoSource1 + 523
21 CoreFoundation 0x01ce968c __CFRunLoopRun + 2156
22 CoreFoundation 0x01ce89d3 CFRunLoopRunSpecific + 467
23 CoreFoundation 0x01ce87eb CFRunLoopRunInMode + 123
24 UIKit 0x006c2d9c -[UIApplication _run] + 840
25 UIKit 0x006c4f9b UIApplicationMain + 1225
26 Test2 0x000027cd main + 141
27 libdyld.dylib 0x0238a701 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Zammy
Posts: 29
Joined: 05 Aug 2014, 16:37

Re: Crash on startup using Xcode 5.1.1 or Xcode6-Beta5

Postby Zammy » 06 Aug 2014, 10:14

Update: I have fixed the issue. It needed

Code: Select all

-lz -ObjC
to be added to "Other Linker Flags" in the Build Settings.

It works with Xcode6-Beta5 with Swift.
User avatar
Lapo
Site Admin
Posts: 19602
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Crash on startup using Xcode 5.1.1 or Xcode6-Beta5

Postby Lapo » 06 Aug 2014, 10:19

I don't know about XCode 6beta, but with 5.1.1 and iOS 7.1 all examples we provide work without any problems. Make sure you are using the latest API available and also make sure you have added all of the dependency libraries.

If you are unsure check the doc at http://docs2x.smartfoxserver.com/Gettin ... t-api-objc

thanks
Lapo
--
gotoAndPlay()
...addicted to flash games
User avatar
Lapo
Site Admin
Posts: 19602
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Crash on startup using Xcode 5.1.1 or Xcode6-Beta5

Postby Lapo » 06 Aug 2014, 10:21

Zammy wrote:Update: I have fixed the issue. It needed

Code: Select all

-lz -ObjC
to be added to "Other Linker Flags" in the Build Settings.

It works with Xcode6-Beta5 with Swift.

Cool. Good to know it's working in the latest beta with Swift.
Cheers
Lapo

--

gotoAndPlay()

...addicted to flash games
Zammy
Posts: 29
Joined: 05 Aug 2014, 16:37

Re: Crash on startup using Xcode 5.1.1 or Xcode6-Beta5

Postby Zammy » 18 Aug 2014, 09:49

Unfortunately I hit a snag trying to deploy on device. I get this with Xcode6-Beta5 :
ld: library not found for -lz


It works OK with Xcode5.1.1. Any tips will be welcomed. As well as what -lz stands for so I can possibly try to fix the problem.

Update1: It seemed that I have not linked with libz library. I added some random libz library from the list and it built and deployed ok.

Return to “SFS2X iPhone / iPad / OSX API”

Who is online

Users browsing this forum: No registered users and 2 guests