Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-19528] iOS: Debugging your app onto device will crash on launch and fail on subsequent builds

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2015-10-23T23:53:36.000+0000
Affected Version/sRelease 5.0.0
Fix Version/sRelease 5.0.0
ComponentsiOS, Tooling
Labelsqe-5.0.0
ReporterWilson Luu
AssigneeEric Merriman
Created2015-09-16T01:12:58.000+0000
Updated2017-03-21T17:02:19.000+0000

Description

*Details:* If you try to debug your app on device, the app will crash on launch. If you try to debug your app on device again, then the build will fail to install to device all together. *Steps to reproduce:*

Create the default Alloy app from Studio

Add a breakpoint on line 2 in the index.js file

Next, debug your app to device

Once the app is installed, try to launch the app

*Actual:* The app will crash on launch:
Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   CoreFoundation                    0x0000000184779bec CFRelease + 1128
1   monkeyBuggy                       0x000000010030d8fc +[TiDebuggerDiscovery currentWiFiName] + 344
2   monkeyBuggy                       0x000000010030d8fc +[TiDebuggerDiscovery currentWiFiName] + 344
3   monkeyBuggy                       0x000000010030cb0c -[TiDebuggerDiscovery startWithKey:hosts:resultBlock:] + 188
4   monkeyBuggy                       0x00000001001787ec __TiThreadPerformOnMainThread_block_invoke (TiBase.m:284)
5   monkeyBuggy                       0x0000000100178bf8 TiThreadProcessPendingMainThreadBlocks (TiBase.m:395)
6   monkeyBuggy                       0x00000001001789f8 __TiThreadPerformOnMainThread_block_invoke214 (TiBase.m:323)
7   libdispatch.dylib                 0x0000000199b0184c _dispatch_call_block_and_release + 24
8   libdispatch.dylib                 0x0000000199b0180c _dispatch_client_callout + 16
9   libdispatch.dylib                 0x0000000199b06e9c _dispatch_main_queue_callback_4CF + 1844
10  CoreFoundation                    0x0000000184850d90 CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE + 12
11  CoreFoundation                    0x000000018484ebf8 __CFRunLoopRun + 1628
12  CoreFoundation                    0x000000018477d8a0 CFRunLoopRunSpecific + 384
13  GraphicsServices                  0x000000018f7d8088 GSEventRunModal + 180
14  UIKit                             0x0000000189e120d4 UIApplicationMain + 204
15  monkeyBuggy                       0x000000010005b72c main (main.m:37)
16  libdyld.dylib                     0x0000000199b328b8 start + 4

Delete the app and try to debug your app to device again

*Actual:* Build will fail with the following error:
[INFO] :   Installing app on device: Eric's 6
[ERROR] :  An error occurred during build after 18s 731ms
[ERROR] :  Failed to copy app to device (0xe8000005)
[ERROR] :  For some reason the app failed to install on the device. Try reconnecting your device and check your provisioning profile and entitlements.
TRACE  | titanium exited with exit code 1
ERROR  | Error: ti run exited with error code 1
    at ChildProcess.<anonymous> (/Users/eric/.appcelerator/install/5.0.0-55/package/node_modules/appc-cli-titanium/plugins/run.js:89:66)
    at ChildProcess.emit (events.js:117:20)
    at Process.ChildProcess._handle.onexit (child_process.js:820:12)
*Expected:* You should be able to debug your app onto device without any issues.

Attachments

FileDateSize
monkeyBuggy 9-15-15, 5-11 PM.crash2015-09-16T01:12:56.000+000042634

Comments

  1. Chee Kiat Ng 2015-09-16

    debugger PR: https://github.com/appcelerator/titanium_debugger/pull/37 timob 5_0_X PR: https://github.com/appcelerator/titanium_mobile/pull/7194 timob master PR: https://github.com/appcelerator/titanium_mobile/pull/7195
  2. Chee Kiat Ng 2015-09-16

    PRs merged.
  3. Harry Bryant 2015-09-16

    Verified fixed, cannot reproduce the error. Able to debug the default Alloy app to device without issue, even after deleting the app and running the debug again. Appcelerator Studio, build: 4.3.0.201509140942 Appc CLI NPM: 4.2.0-8 Appc CLI Core: 5.0.0 SDK: 5.0.0.v20150915230722 Node: v0.10.38 OS: Yosemite (10.10.5) Xcode: 7 GM Seed Device: iphone 6 plus (8.3)
  4. Eric Wieber 2015-10-23

    Reopening as this appears to be happening again. I just encountered this error (same output/errors) using: MacOS 10.11.1 (15B42) Studio 4.4.0.201510231805 Ti SDK 5.1.0.v20151022152020 Appc NPM Appc CLI 5.1.0-38 Ti CLI 5.0.5 Alloy 1.7.16 Arrow 1.3.13 Xcode 7.1 (7B91b) Node v0.12.7 Java 1.7.0_80 production
       [INFO] :   debugtest/1.0 (0.0.0.442676a)
       [INFO] :   -[KrollContext contextId]: unrecognized selector sent to instance 0x1380364b0
       [INFO] :   *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[KrollContext contextId]: unrecognized selector sent to instance 0x1380364b0'
       [INFO] :   *** First throw call stack:
       [INFO] :   (0x186288f48 0x19ae3bf80 0x18628fc5c 0x18628cc00 0x186190cac 0x100336a00 0x10009dc8c 0x10009d214 0x19b6596e8 0x19b6596a8 0x19b65edb0 0x1862401f8 0x18623e060 0x18616cca0 0x1913a8088 0x18b884ffc 0x10007da8c 0x19b68a8b8)
       
    However, setting false will allow you to debug your app as intended.
  5. Ingo Muschenetz 2015-10-23

    Once TIMOB-19760 is merged, this default behavior will be to run off the main thread by default.
  6. Lee Morris 2017-03-21

    Closing ticket as fixed.

JSON Source