-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Allow FLUTTER_APPLICATION_PATH to be null for misconfigured Xcode projects #57701
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
dnfield
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM and seems to make perfect sense, is there some way we can test it?
I can create a misconfigured integration test that tests this exact scenario. But, I hate adding them to the Flutter repo since it bloats everyone's install every so slightly each time. More importantly, there are infinite ways to mess up an Xcode project (and enough bad advice on SO to keep us busy forever) and we can't test them all. Any of the below are better fixes than this, but I wanted something focused so it's hot-fixable.
|
|
Could we just directly invoke xcode_backend.sh with some flag that tests this path? |
Calling it directly from an integration test. |
* fix segment hit test behavior (#57461) * Making DropdownButtonFormField to re-render if parent widget changes (#57037) * Update DropdownButtonFormField's state if widget updates Co-authored-by: Shi-Hao Hong <[email protected]> * throw more specific toolexit when git fails during upgrade (#57162) * [flutter_tools] Refresh VM state before executing hot reload (#53960) * Update engine hash for 1.17.2 * Remove MaterialControls from examples/flutter_view (#57621) Co-authored-by: Jenn Magder <[email protected]> * Prevent building non-android plugins in build aar (#58018) * Allow FLUTTER_APPLICATION_PATH to be null for misconfigured Xcode projects (#57701) * Don't import plugins that don't support android in settings.gradle (#54407) Co-authored-by: LongCatIsLooong <[email protected]> Co-authored-by: Pedro Massango <[email protected]> Co-authored-by: Shi-Hao Hong <[email protected]> Co-authored-by: Christopher Fujino <[email protected]> Co-authored-by: Jason Simmons <[email protected]> Co-authored-by: stuartmorgan <[email protected]> Co-authored-by: Jenn Magder <[email protected]> Co-authored-by: Emmanuel Garcia <[email protected]>
Description
Some users have misconfigured Xcode projects base build configurations and incorrectly swapped to Pods-Runner.debug.xcconfig instead of Debug.xcconfig. They were getting around this by following Stack Overflow-quality advice and manually adding a
FLUTTER_ROOTbuild setting.#51453 started calling the embed function in
xcode_backend, which checks ifFLUTTER_APPLICATION_PATHexists. That variable isn't set for these misconfigured users.flutter/packages/flutter_tools/bin/xcode_backend.sh
Line 267 in 2a5690f
As a workaround, copy the build check behavior that falls back to
SOURCE_ROOT. Keep the same.iosandiosdance to make this as minimum a change as possible.flutter/packages/flutter_tools/bin/xcode_backend.sh
Lines 42 to 45 in 2a5690f
They still have misconfigured Xcode projects, but at least they won't be worse off than before #51453.
Related Issues
Fixes #56507
Would have been never been needed with #12749 or #12751.
Tests
I tested this by misconfiguring my base configuration to the Pod variants, and adding a
FLUTTER_ROOTbuild setting. I get theThe path does not existbefore this change, and a successful build after. The existing integration tests will prove that the default and correctly configuredflutter createproject still works.Checklist
///).flutter analyze --flutter-repo) does not report any problems on my PR.Breaking Change