Skip to content

Conversation

@goderbauer
Copy link
Member

When Xcode uploads an app to the App Store it invokes symbols to generate debug information for embedded frameworks. symbols uses Spotlight to find dSYM files for the framework binaries (mdfind "com_apple_xcode_dsym_uuids == <uuid of framework>") and for some reason it exits with an error code (bug?) if it finds a dSYM file. The error exit code causes the app store upload to fail.

This change hides the dSYM file from Xcode by placing it in a folder ending with .noindex.

When Xcode uploads an app to the App Store it invokes `symbols` to generate debug information for embedded frameworks. `symbols` uses Spotlight to find dSYM files for the framework binaries (`mdfind "com_apple_xcode_dsym_uuids == <uuid of framework>"`) and for some reason it exits with an error code (bug?) if it finds a dSYM file. The error exit code causes the app store upload to fail.

This change hides the dSYM file from Xcode by placing it in a folder ending with `.noindex`.
Copy link
Member

@chinmaygarde chinmaygarde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What a straightforward patch for completely intuitive behavior! LGTM.

Copy link
Member

@cbracken cbracken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. Nicely done!


StreamOutput " ├─Generating dSYM file..."
RunCommand xcrun dsymutil -o "${build_dir}/aot/App.dSYM" "${app_framework}/App"
# Placing dSYMs in a folder ending with ".noindex" so xcode cannot find them
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uber-nit: s/xcode/Xcode/

@eseidelGoogle
Copy link
Contributor

Have we filed a radar with Apple? :) I find it hard to imagine this is intentional behavior.

# Placing dSYMs in a folder ending with ".noindex" so Xcode cannot find them
# via Spotlight and get confused when uploading an App to the App Store.
mkdir "${build_dir}/dSYMs.noindex"
RunCommand xcrun dsymutil -o "${build_dir}/dSYMs.noindex/App.framework.dSYM" "${app_framework}/App"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

totally nit-picking: The comment here is confusing to me. It's not a complete sentence. s/Placing/Place/ would fix the grammar, but I think it might be best to phrase the thing backwards: "Xcode uses Spotlight to find files when uploading them to the App store, and gets confused if it finds dSYM files when doing so. To avoid this, we place the dSYM files in a folder ending with ".noindex", which disables spotlight. See: <link to radar>"

Copy link
Member

@cbracken cbracken Oct 2, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe even more specifically:
Xcode uses Spotlight metadata to locate (by GUID) the dSYM associated with each framework embedded in the app to be uploaded to the App Store. If the dSYM cannot be found, the upload fails with an error when 'upload with symbols' is set. To hide the dSYM from spotlight, we place it in a directory ending in '.noindex', which disables spotlight.

For the radar, search on openradar first, then file one and copy-paste into openradar if you can't find one.

@goderbauer goderbauer merged commit bfa9822 into flutter:master Oct 3, 2018
@goderbauer goderbauer deleted the fixDsyms branch October 3, 2018 01:28
@liniminil
Copy link

mkdir: build/dSYMs.noindex will fail if the folder already exists.

@goderbauer goderbauer added tool Affects the "flutter" command-line tool. See also t: labels. a: size Reducing IPA/APK/JS sizes labels Feb 22, 2019
@xster xster mentioned this pull request Jul 30, 2019
9 tasks
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

a: size Reducing IPA/APK/JS sizes tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants