Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode, Parse Crash Reporting, dSYM file not created

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()
    });
}
like image 259
blwinters Avatar asked Dec 11 '22 00:12

blwinters


1 Answers

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.

like image 162
udjat Avatar answered Dec 30 '22 16:12

udjat