{ "id": "173115", "key": "AC-6167", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "8", "description": "", "name": "Needs more info" }, "resolutiondate": "2019-05-01T22:26:19.000+0000", "created": "2019-03-11T23:12:25.000+0000", "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2019-05-01T22:26:19.000+0000", "status": { "description": "A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.", "name": "Resolved", "id": "5", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [], "description": "Hi,\r\n\r\nI am developing a module for New Relic to report crashes. I've attached a few sample projects at the bottom of this ticket, Native App sample xcode project and my module xcode project.\r\n\r\nIf I run the native app, I can see the crashes report as expected. The app fully crashes.\r\n\r\nHowever when I do the same thing in the Appc sample app using the module, I see the Appc red error screen, and the crash is not reported in New Relic's dashboard. I and my colleague believe that Appc is catching the crash and not letting it propagate to where it needs to go.\r\n\r\n*To test and recreate:*\r\n1. Open a test account with New Relic at https://newrelic.com/signup?via=login\r\n2. Follow the installation guide, chose iOS, and create a test app for your dashboard. Scroll down to the bottom of the screen to \"Activate mobile apps\" (green button).\r\n3. once that is set up, you should be able to click the green area in the header and select Mobile, and you will see a dashboard.\r\n\r\nAt this point you'll need your Application Token, which can be found by clicking the Installation link at the left again. You'll see your token on the right.\r\n\r\n*Test iOS Native app sample*\r\n1. In my attached native app sample (see dropbox links below), paste your application token in the AppDelgate.m, line 21, in the placeholder.\r\n2. Also paste the token in the project Run Script in Build Phases. This is not necessary, it is supposed to upload the dSYM after building. \r\n3. Build and run to a device. In a few minutes you should see in your New Relic dashboard a registered app launch. Back in the app, if you click the \"Button\" it should crash the app, and in a minute or so you should see the crash registered in the New Relic dashboard.\r\n4. If you view the crash you can upload the dSYM for the build here to de-obfuscate the error, but not necessary.\r\n \r\n*Test Appc sample app:*\r\n1. Add your Application Token to the XcodeModuleProject and build the module.\r\n2. Create a new test app, and install the module. In Index.js, change the boilerplate to:\r\n\r\n{code:java}\r\nvar nr = require(\"com.newrelic\");\r\n\r\nfunction doClick(e) {\r\n\tnr.crash();\r\n}\r\n\r\n$.index.open();\r\n{code}\r\n\r\n3. run the app on a device or simulator and click the Hello World label. This should simulate a New Relic crash, and you'll see the Appc red error screen, it should say \"Forcing crash in new relic module\" which is being logged in the module. The app itself will not fully crash as it does in the native sample app.\r\n\r\nIt is here that I think Appc is catching the crash and not letting it propagate to the New Relic module's SDK.\r\n\r\nPlease let me know if someone might be able to tell me why I am not seeing the Appc sample app crash being reported in the New Relic dashboard. My colleague and I feel that we've implemented the module correctly, but can't figure out why the crash is not registering with the dashboard.\r\n\r\n*Source files:*\r\nNative ios xcode project\r\nhttps://www.dropbox.com/s/jzv5vs4rmb8vd3o/NativeIosProject.zip?dl=0\r\n\r\nModule xcode project\r\nhttps://www.dropbox.com/s/8wl0e6xfhxmp1oi/XcodeModuleProject.zip?dl=0\r\n\r\nThanks!\r\n", "attachment": [], "flagged": false, "summary": "iOS New Relic module not able to post crash report", "creator": { "name": "eric.harms@gmail.com", "key": "eric.harms@gmail.com", "displayName": "eric harms", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "eric.harms@gmail.com", "key": "eric.harms@gmail.com", "displayName": "eric harms", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "446790", "author": { "name": "eric.harms@gmail.com", "key": "eric.harms@gmail.com", "displayName": "eric harms", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hi, \r\n\r\nwe've remedied this one by substituting New Relic's test crash method with the following, which seems to bypass Appcelerator and let us post the crash to New Relic. Is there a reason why this gets through?\r\n\r\n{code:java}\r\n@throw NSInternalInconsistencyException;\r\n{code}\r\n", "updateAuthor": { "name": "eric.harms@gmail.com", "key": "eric.harms@gmail.com", "displayName": "eric harms", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-03-12T22:55:45.000+0000", "updated": "2019-03-12T22:55:45.000+0000" }, { "id": "446842", "author": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "body": "The error is throwing on the native side of a JS function. We catch such errors and convert them to a JS error instead. You can see the behavior with the following code:\r\n\r\n{code:javascript}\r\nvar nr = require('com.newrelic');\r\ntry {\r\n\tnr.crash();\r\n} catch (e) {\r\n\tconsole.log(e);\r\n}\r\n{code}\r\n\r\nI assume NewRelic uses the top-level handler for uncaught exceptions to do their reporting. In this case the exception is actually caught by us so NewRelic can't report anything.\r\n\r\nYou can try and hook into our exception handler and manually record the exception using our [TiExceptionHandlerDelegate|https://github.com/appcelerator/titanium_mobile/blob/b0726db82ba7b70a1a021df8bd8c7ad84aab9717/iphone/TitaniumKit/TitaniumKit/Sources/API/TiExceptionHandler.h#L57] and [recordHandledException|https://docs.newrelic.com/docs/mobile-monitoring/new-relic-mobile-ios/ios-sdk-api/record-handled-exception]:\r\n{code}\r\n[TiExceptionHandler defaultExceptionHandler].delegate = self;\r\n{code}\r\n\r\nand then implement the following delegate methods:\r\n\r\n{code}\r\n- (void)handleUncaughtException:(NSException *)exception;\r\n- (void)handleScriptError:(TiScriptError *)error;\r\n{code}\r\n\r\nHope this helps! Would be great to see NewRelic support again ;)", "updateAuthor": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "created": "2019-03-14T18:36:38.000+0000", "updated": "2019-03-14T18:41:18.000+0000" }, { "id": "447008", "author": { "name": "rmitro", "key": "rmitro", "displayName": "Rakhi Mitro", "active": false, "timeZone": "America/Los_Angeles" }, "body": "[~eric.harms@gmail.com],\r\nI thought I’d check in to see how things are progressing with your need? Just following up to check the status of this case and if you need further help on it. \r\n\r\nPlease let us know if the problem persists. \r\n\r\nHave a great day.\r\n\r\n", "updateAuthor": { "name": "rmitro", "key": "rmitro", "displayName": "Rakhi Mitro", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2019-03-20T08:08:01.000+0000", "updated": "2019-03-20T08:08:01.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }