Bugly automatically upload script and report zip error: nothing to do! In xcode10

First, the solution:
“For dsymFile in $(find “$DSYM_FOLDER” -name ‘*.dsym ‘) Add the “sleep 2s” command before the do line,
That is

            #Delay the zip operation for two seconds.
            sleep 2s

            for dsymFile in $(find "$DSYM_FOLDER" -name '*.dSYM'); do
            echo "Found dSYM file: $dsymFile"

The purpose was to delay the execution of the zip-r-j $DSYM_SYMBOL_ZIP_FILE $dsymfile-x *.plist command by 2 seconds.

Bugly provides the function of directly uploading dSYM files with script automatic configuration. However, when I was in XCODE10, I found that there was no corresponding dSYM file on the “Symbol Table Management” page of The Bugly website. After checking the script output at compile time of Xcode, I found the following error prompt:
zip error: Nothing to do! (…)
Error: Failed to upload the zip archive file.
FAILTURE – dSYM upload complete.
Failed to upload the dSYM
The crux of the above error is the first zip error: Nothing to do! . Because the zip did not compress successfully, *.dsym.zip could not be found to upload the symbol table.
zip error: Nothing to do! This means there is no file to compress and nothing to do.
After constant testing and speculation, it is thought that it may be the execution of the ZIP command, dSYM symbol table file is not generated, so no file can be compressed. Simply add a 2s delay command before zip, no longer report an error, and successfully upload Bugly.
But after all, this way is rude, just like adding a delay function in the iOS code without knowing when to refresh the interface, which is not reliable. But at least it solves my emergency.

Read More: