Titanium JIRA Archive
Appcelerator Community (AC)

[AC-4443] iOS device crashes on webview add to window

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionNot Our Bug
Resolution Date2016-09-09T17:39:47.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelscrash, ios, webview
ReporterJohn Staunton
AssigneeHans Knöchel
Created2016-09-09T14:55:46.000+0000
Updated2016-09-09T17:39:47.000+0000

Description

Creating a new app and adding a webview (as per the example in Titanium documentation) causes the app to crash on an iOS device. Android device & iOS simulator work fine. Steps to reproduce: 1) Create a new Mobile App Project 2) Paste the sample code for creating a webview into index.js:
var webview = Titanium.UI.createWebView({url:'http://www.appcelerator.com/'});
var window = Titanium.UI.createWindow();
window.add(webview);
window.open({modal:true});
3) Compile & Launch app - on a device, will crash immediately on attempting to add the webview, with log trace:
[INFO] :   TestWebview/1.0 (5.4.0.4ba4c0a)
[ERROR] :  The application has crashed with an uncaught exception 'NSInvalidArgumentException'.
[ERROR] :  Reason:
[ERROR] :  -[__NSCFBoolean hasPrefix:]: unrecognized selector sent to instance 0x1a16306d8
[ERROR] :  Stack trace:
[ERROR] :  
[ERROR] :  0   CoreFoundation                      0x00000001835badb0 <redacted> + 124
[ERROR] :  1   libobjc.A.dylib                     0x0000000182c1ff80 objc_exception_throw + 56
[ERROR] :  2   CoreFoundation                      0x00000001835c1c4c <redacted> + 0
[ERROR] :  3   CoreFoundation                      0x00000001835bebec <redacted> + 872
[ERROR] :  4   CoreFoundation                      0x00000001834bcc5c _CF_forwarding_prep_0 + 92
[ERROR] :  5   UIKit                               0x000000018894c888 <redacted> + 196
[ERROR] :  6   UIKit                               0x000000018894c558 <redacted> + 124
[ERROR] :  7   libdispatch.dylib                   0x000000018300547c <redacted> + 16
[ERROR] :  8   libdispatch.dylib                   0x00000001830062c0 dispatch_once_f + 80
[ERROR] :  9   UIKit                               0x0000000188b97d8c <redacted> + 72
[ERROR] :  10  UIKit                               0x000000018894c3ec <redacted> + 80
[ERROR] :  11  TestWebview                         0x00000001000ce96c TestWebview + 747884
[ERROR] :  12  TestWebview                         0x00000001000ceee8 TestWebview + 749288
[ERROR] :  13  TestWebview                         0x00000001000d1760 TestWebview + 759648
[ERROR] :  14  TestWebview                         0x0000000100087960 TestWebview + 457056
[ERROR] :  15  TestWebview                         0x0000000100087d08 TestWebview + 457992
[ERROR] :  16  TestWebview                         0x0000000100074430 TestWebview + 377904
[ERROR] :  17  TestWebview                         0x000000010005174c TestWebview + 235340
[ERROR] :  18  TestWebview                         0x000000010004f854 TestWebview + 227412
[ERROR] :  19  TestWebview                         0x000000010004f9a0 TestWebview + 227744
[ERROR] :  20  TestWebview                         0x0000000100048eec TestWebview + 200428
[ERROR] :  21  TestWebview                         0x0000000100048b8c TestWebview + 199564
[ERROR] :  22  CoreFoundation                      0x00000001835c0a60 <redacted> + 144
[ERROR] :  23  CoreFoundation                      0x00000001834b8488 <redacted> + 284
[ERROR] :  24  TestWebview                         0x00000001000384f4 TestWebview + 132340
[ERROR] :  25  TestWebview                         0x0000000100036b84 TestWebview + 125828
[ERROR] :  26  TestWebview                         0x00000001000ae294 TestWebview + 615060
[ERROR] :  27  TestWebview                         0x00000001000368a4 TestWebview + 125092
[ERROR] :  28  TestWebview                         0x00000001002263c8 TestWebview + 2155464
[ERROR] :  29  TestWebview                         0x00000001002c1200 TestWebview + 2789888
[ERROR] :  30  TestWebview                         0x00000001002c7138 TestWebview + 2814264
[ERROR] :  *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFBoolean hasPrefix:]: unrecognized selector sent to instance 0x1a16306d8'
[ERROR] :  *** First throw call stack:
[ERROR] :  (0x1835badb0 0x182c1ff80 0x1835c1c4c 0x1835bebec 0x1834bcc5c 0x18894c888 0x18894c558 0x18300547c 0x1830062c0 0x188b97d8c 0x18894c3ec 0x1000ce96c 0x1000ceee8 0x1000d1760 0x100087960 0x100087d08 0x100074430 0x10005174c 0x10004f854 0x10004f9a0 0x100048eec 0x100048b8c 0x1835c0a60 0x1834b8488 0x1000384f4 0x100036b84 0x1000ae294 0x1000368a4 0x1002263c8 0x1002c1200 0x1002c7138)

Comments

  1. John Staunton 2016-09-09

    Sorry, should have specified: Appcelerator Studio, build: 4.7.0.201607250649 Alloy v1.9.1 Ti SDK 5.4.0.GA
  2. John Staunton 2016-09-09

    Some further info - webview works on some iOS devices but not others: - Loads correctly on iPad mini (Model FF432NF/A) running iOS 9.1 (13B143) - Loads correctly on SAME iPad mini (Model FF432NF/A) running iOS 9.3.5 (13G36) - Crashes on iPad Air 2 (Model MGL12HC/A) running iOS 9.3.4 (13G35)
  3. John Staunton 2016-09-09

    Several hours later, we finally discovered that something is being cached on the iPads that is causing the issue - wiping the iPads clean and reinstalling the app made it work perfectly again. This issue can be closed as a PICNIC (Problem In Chair, Not In Computer) ;)
  4. Hans Knöchel 2016-09-09

    Thanks! Closing issue.

JSON Source