pec1985 / TiSMSView

Expandable Text Area Module - iOS - Titanium
Other
60 stars 18 forks source link

Crash with iOS 5 SDK #46

Closed sindresorhus closed 12 years ago

sindresorhus commented 12 years ago

When building the example app (commit 9f56bfad474711ec7f0f807a63994ec7c2eba814) with the iOS 5 SDK it crashes. It works fine with 4.3.2.

Titanium Mobile SDK 1.7.3

Console dump:

[ERROR] The application has crashed with an unhandled exception. Stack trace:

0   CoreFoundation                      0x02e49052 __exceptionPreprocess + 178

1   libobjc.A.dylib                     0x02c69d0a objc_exception_throw + 44

2   CoreFoundation                      0x02df1a78 +[NSException raise:format:arguments:] + 136

3   CoreFoundation                      0x02df19e9 +[NSException raise:format:] + 57

4   UIKit                               0x009ffda4 __windowForView + 158

5   UIKit                               0x00a01bf2 -[UIView(Hierarchy) _postMovedFromSuperview:] + 30

6   UIKit                               0x00a06a4f -[UIView(Internal) _addSubview:positioned:relativeTo:] + 1633

7   UIKit                               0x00a0072b -[UIView(Hierarchy) addSubview:] + 56

8   SMSViewTest                         0x0031fe9f -[PESMSTextArea layoutSubviews] + 275

9   UIKit                               0x00a08322 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 178

10  CoreFoundation                      0x02e4ae72 -[NSObject performSelector:withObject:] + 66

11  QuartzCore                          0x01cbc92d -[CALayer layoutSublayers] + 266

12  QuartzCore                          0x01cc6827 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 231

13  QuartzCore                          0x01c4cfa7 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 377

14  QuartzCore                          0x01c4eea6 _ZN2CA11Transaction6commitEv + 374

15  QuartzCore                          0x01c4e580 _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 80

16  CoreFoundation                      0x02e1d9ce __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 30

17  CoreFoundation                      0x02db4670 __CFRunLoopDoObservers + 384

18  CoreFoundation                      0x02d804f6 __CFRunLoopRun + 1174

19  CoreFoundation                      0x02d7fdb4 CFRunLoopRunSpecific + 212

20  CoreFoundation                      0x02d7fccb CFRunLoopRunInMode + 123

21  GraphicsServices                    0x0285d879 GSEventRunModal + 207

22  GraphicsServices                    0x0285d93e GSEventRun + 114

23  UIKit                               0x009c9a9b UIApplicationMain + 1175

24  SMSViewTest                         0x0000479a main + 442

25  SMSViewTest                         0x000030e5 start + 53

2011-10-29 19:27:27.999 SMSViewTest[5789:17603] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Requesting the window of a view (<UIButton: 0x8c06e40; frame = (0 0; 0 0); transform = [0, 0, 0, 0, 0, 0]; alpha = 0; opaque = NO; autoresize = TM; layer = (null)>) with a nil layer. This view probably hasn't received initWithFrame: or initWithCoder:.'

*** First throw call stack:

(0x2e49052 0x2c69d0a 0x2df1a78 0x2df19e9 0x9ffda4 0xa01bf2 0xa06a4f 0xa0072b 0x31fe9f 0xa08322 0x2e4ae72 0x1cbc92d 0x1cc6827 0x1c4cfa7 0x1c4eea6 0x1c4e580 0x2e1d9ce 0x2db4670 0x2d804f6 0x2d7fdb4 0x2d7fccb 0x285d879 0x285d93e 0x9c9a9b 0x479a 0x30e5)

terminate called throwing an exception
[DEBUG] App Spec: <DTiPhoneSimulatorApplicationSpecifier 0x100126f00> specified by path /Users/sindresorhus/Projects/Titanium/SMSViewTest/build/iphone/build/Debug-iphonesimulator/SMSViewTest.app
[DEBUG] SDK Root: <DTiPhoneSimulatorSystemRoot 0x100125fb0> path=/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk version=5.0 name=Simulator - iOS 5.0
[DEBUG] using device family iphone
[DEBUG] Session started
[DEBUG] Session did end with error (null)
[INFO] Application has exited from Simulator
pec1985 commented 12 years ago

I fixed this the other day. Download and rebuild again.

bentindall commented 12 years ago

I'm also having problems with running this module in iOS5.

I downloaded the latest source from github (9f56bfa), compiled it in XCode 4.2 with the help of the url you mentioned (http://wiki.appcelerator.org/display/guides/iOS+Module+Development+Guide), copied the libti.smsview.a file into modules/iphone/ti.smsview/1.0 and then used the app.js from the samples directory.

As soon as I run the app using the iPhone 5.0 simulator, it crashes out:

[DEBUG] Session did end with error Error Domain=DTiPhoneSimulatorErrorDomain Code=1 UserInfo=0x10030fb90 "The simulated application quit." [INFO] Application has exited from Simulator

It works fine in the iPhone 4.3 simulator. I'm using Titanium SDK 1.7.5, but i've also tested it on 1.7.6.v20111114104114 and 1.8.0v20111114103905, and it also doesn't work on either of those.

I've also tested this in Ad-hoc mode on an iPhone 4 running iOS 5.0.1, and it also bombs out.

Could you please have a look at this? Or if it's difficult is there a workaround.

Thanks!

amigoni commented 12 years ago

I think I found the solution. In the example app.js at the bottom. Change

win.open({modal:true,animated:false});

to

win.open()

You might also have to che the orientation options. I removed those too. Now it works well.

sindresorhus commented 12 years ago

Works for me in 1.1 and Titanium 1.8. Closing.