4

I have an iOS app, written in Swift in Xcode 6.2, using the Parse SDK 1.7.0. I've gone through the Parse Quick Start instructions for setting up crash reporting (including ParseCrashReporting.enable() in the AppDelegate), but it seems that my run script is having an issue. The error is: App "/Users/ben/Library/Developer/Xcode/DerivedData/MyApp-ahydphsjgdgefbhcdodokcmofehe/Build/Products/Debug-iphonesimulator/MyApp.app.dSYM" wasn't found. Command /bin/sh failed with exit code 1.

According to this, it seems that Xcode is not creating the dSYM file. In my Build Settings > Build Options I have changed Debug Information Format to "DWARF with dSYM file" for both Debug and Release. (Previously, Debug was set to "DWARF")

Should I change anything else in the Build Options?

Also, could this be the issue? export DWARF_DSYM_FILE_SHOULD_ACCOMPANY_PRODUCT=NO

Here is my run script:

export PATH=/usr/local/bin:$PATH
cd $PROJECT_DIR/parse

parse symbols "${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}"

Thank you in advance for any ideas about how to fix this.

Edit: Thanks to the answer from @udjat, I was able to run my app and run script (below) without the app crashing. And thanks to some bug fixes from Parse, the test crash reports are functioning now as well, though there is still a significant delay.

New run script:

echo "Parse Crash Reporting"
export PATH=/usr/local/bin:$PATH
CLOUD_CODE_DIR=${PROJECT_DIR}/parse

if [ -d ${CLOUD_CODE_DIR} ]; then
cd ${CLOUD_CODE_DIR}
parse symbols MyApp --path="${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}"
echo "Finished uploading symbol"
else
echo "Unable to upload symbols"
fi

Crash test in AppDelegate:

func crash() {
    NSException(name:NSGenericException, reason:"Everything is ok. This is just a test crash.", userInfo:nil).raise()
}

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject : AnyObject]?) -> Bool {

    ParseCrashReporting.enable()

    dispatch_after(
        dispatch_time(DISPATCH_TIME_NOW, Int64(5.0 * Double(NSEC_PER_SEC))),
        dispatch_get_main_queue(),
        { () -> Void in
            self.crash()
    });
}
blwinters
  • 1,911
  • 19
  • 40
  • Are you absolutely sure your going to the right directory? I don't see anything wrong. This works for me: [Parse Crash Reporting Not Working](http://stackoverflow.com/questions/28755933/parse-crash-reporting-not-working) – nick9999 Mar 20 '15 at 04:11
  • Additionally, I noticed that the log includes `export DWARF_DSYM_FILE_SHOULD_ACCOMPANY_PRODUCT=NO`. It seems like changing this to `YES` might solve the issue, but I can't find where to change it. Any ideas? – blwinters Mar 27 '15 at 18:28
  • That's probably the exact issue. I personally don't know to fix it because I've never had this issue but I'll look into it – nick9999 Mar 27 '15 at 19:20
  • Thanks again. I just deleted and reinstalled Xcode, same error message. – blwinters Mar 27 '15 at 20:01
  • That error message you posted; is it two errors or one error? – nick9999 Mar 27 '15 at 20:02
  • Just one error. "Shell Script Invocation Error" – blwinters Mar 27 '15 at 20:09
  • Can you remove crash reporting for now? Just to narrow in on one issue. – nick9999 Mar 27 '15 at 20:29
  • I just deleted my Run Script from Build Phases and there were no errors. – blwinters Mar 27 '15 at 20:32
  • Ok then....can you try using the code from the question/answer I linked above? – nick9999 Mar 27 '15 at 20:33
  • I recreated the Run Script according to your link and I received the same error as before. Here is a [link](https://www.dropbox.com/s/snh90l5i1ig57e8/Build%20Settings%20Screenshots.zip?dl=0) to screenshots of my build settings. – blwinters Mar 27 '15 at 20:48

6 Answers6

8

After reading through the Facebook link @jairobjunior posted, I found the fix (at least for myself) in Árni Jón Reginsson's answer and modified a bit.

In the Parse document, your run script is:

export PATH=/usr/local/bin:$PATH
cd YOUR_PATH
parse symbols "${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}"

Instead, change it to:

echo "Parse Crash Reporting"
export PATH=/usr/local/bin:$PATH
CLOUD_CODE_DIR=${PROJECT_DIR}/ParseCloudCode(or wherever yours is)

if [ -d ${CLOUD_CODE_DIR} ]; then
    cd ${CLOUD_CODE_DIR}
    parse symbols YOUR_PARSE_APP_NAME --path="${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}"
    echo "Finished uploading symbol"
else
    echo "Unable to upload symbols"
fi

And it takes a lot more than "up to one minute" for your crash reports to show up on Parse (took me more than 15 minutes). If it finished uploading, it will be there, you just need to be patient.

udjat
  • 479
  • 2
  • 10
  • Please see updated answer. I had the same error some time ago and I believe I managed to fix it with it. @blwinters – udjat Mar 30 '15 at 13:29
  • Thanks @udjat. The run script you suggested seems to work to create the dSYM file. However, when I go through the crash test process according to the [Parse documentation](https://www.parse.com/docs/ios_guide#crashreporting-testing/iOS) nothing shows up in my crash analytics. I've edited my question to show the new run script and crash test in AppDelegate. Would you mind taking a look at it? – blwinters Mar 30 '15 at 17:33
  • @blwinters It took Parse a few long minutes for me to see the crash reports (>15 mins) instead of "up to a minute" as Parse suggests in their docs. I assume it would take yours about the same time to show up. :) – udjat Mar 30 '15 at 17:53
  • It has been several hours since I went through the test crash process (several times), but there is still nothing. I tried it in the simulator as well as on a device. Are there any other special requirements for crash analytics? – blwinters Mar 30 '15 at 22:28
3

There is an open thread about this issue here: https://developers.facebook.com/bugs/587774604658221/

I am having the same problem, even trying to do manually it says file "wasn't found", but the file is there. One thing that I've noticed is that .dSYM is not a file, for me it seems to be a folder/package.

jairobjunior
  • 473
  • 5
  • 11
2

I found this to work..

export PATH=/usr/local/bin:$PATH
cd YOUR_PATH
parse symbols AppName -p "${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}"

Adding the app name and the -p to the parse line

Byron Coetsee
  • 3,533
  • 5
  • 20
  • 31
0

Sorry I don't have the reputation to comment so I'll leave this as an answer.

I got the exact problem. Also using the latest Parse SDK. It is suspected that it is the problem of the latest CLI 2.0.0 since developers start getting the issues you're getting (and also I'm getting) after updating to 2.0.0

Subscribe to this Facebook bug reporting post to get the solution in the future. https://developers.facebook.com/bugs/466020460223551/

At this moment it seems like the problem is from the SDK. So there is nothing to do except waiting for Parse to fix this.

(Thanks @jairobjunior for introducing me the Facebook bug reporting page!)

Henry Ngan
  • 572
  • 1
  • 4
  • 24
0

just wanted to let you know you're not alone: although my DSYM seems to upload fine, no crash reports from any of my apps ever show up on parse.com, no matter what I do. I've spent an hour checking every setting... all looks good. I use the same test crash as you do...

So, please update here if you find a solution to crashes not showing up on parse.com. thanks!

xaphod
  • 6,392
  • 2
  • 37
  • 45
  • Yeah, for some reason I have a single crash report (single occurrence) from March 29 in Parse analytics, before I fixed the other issues, but I haven't been able to create a new crash report. I'll try to delete all builds/CLI/dSYM and reinstall when I have some time. – blwinters Mar 31 '15 at 17:32
  • update, 5 hours or so later: boom, all of a sudden my parse crash reports showed up. It took 12 hours for the last one to show up... so wait 12 hours after making "fixes" to see if it works. – xaphod Mar 31 '15 at 19:53
  • I just checked and found 29 new occurrences. I guess they had to unclog the pipes. – blwinters Mar 31 '15 at 20:06
0

In my case the problem was probably create by changing the project name, anyway using the following script made it :

parse symbols MyAppName --path="${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}"

Where MyAppName is was what I found in the parse/config file :

{
    "applications": {
        "MyAppName": {
            "applicationId": "....kjsldgjslkgjslkgj...",
            "masterKey": "....lksjmll242dg2d1g2..."
        },
        "_default": {
            "link": "MyAppName"
        }
    }
}
Dulgan
  • 6,674
  • 3
  • 41
  • 46