Skip to content

Packages are not supported when using legacy build locations, but the current project has them enabled #76868

Closed

Description

@ammaratef45

I had the issue at #57083 The solution from This comment works but when I have a clean clone the problem starts again
Note: I have the changes to the file Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata committed to the codebase

Steps to Reproduce

  1. Create a new flutter app
  2. Add a swift package to the ios project
  3. if xcodebuild -list fails use this solution
  4. if you followed step 3 commit the changes of the file Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata to your codebase.
  5. push everything and then have a clean clone and try xcodebuild -list

Expected results: The solution worked before and it should work no problem.

Actual results: You still need to change from legacy to xcode-default

flutter run --verbose output

output.txt

flutter doctor -v output

[✓] Flutter (Channel stable, 1.22.6, on Mac OS X 10.15.7 19H524 darwin-x64,
    locale en-US)
    • Flutter version 1.22.6 at /Users/ahussein/development/flutter
    • Framework revision 9b2d32b605 (5 weeks ago), 2021-01-22 14:36:39 -0800
    • Engine revision 2f0af37152
    • Dart version 2.10.5

 
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/ahussein/Library/Android/sdk
    • Platform android-30, build-tools 30.0.3
    • Java binary at: /Applications/Android
      Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build
      1.8.0_242-release-1644-b3-6915495)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 12.4)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.4, Build version 12D4e
    • CocoaPods version 1.10.0

[!] Android Studio (version 4.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
    • Java version OpenJDK Runtime Environment (build
      1.8.0_242-release-1644-b3-6915495)

[✓] VS Code (version 1.53.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.19.0

[✓] Connected device (1 available)
    • Ammar’s iPhone (mobile) • 07e805c86df752a6bf2ccdb27e6094290a8c9cda • ios •
      iOS 14.4

! Doctor found issues in 1 category.

More docs

  • screenshot of ios/Runner.xcodeproj (not Runner.xcworkspace) > File > Project Settings > Per-User Project Settings: > Advanced. (after a clean clone)
    Screen Shot 2021-02-26 at 11 03 15 AM

  • ios/Runner.xcodeproj/project.xcworkspace/xcuserdata/USER.xcuserdatad/WorkspaceSettings.xcsetting

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>BuildLocationStyle</key>
	<string>UseTargetSettings</string>
	<key>CustomBuildLocationType</key>
	<string>RelativeToDerivedData</string>
	<key>DerivedDataLocationStyle</key>
	<string>Default</string>
	<key>IssueFilterStyle</key>
	<string>ShowActiveSchemeOnly</string>
	<key>LiveSourceIssuesEnabled</key>
	<true/>
	<key>ShowSharedSchemesAutomaticallyEnabled</key>
	<true/>
</dict>
</plist>
  • ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
   version = "1.0">
   <FileRef
      location = "self:">
   </FileRef>
</Workspace>

Activity

  1. jmagman commented on Feb 26, 2021

    @jmagman
    Member

    Thanks for all the details!

    1. Can you also attach a screenshot of ios/Runner.xcodeproj (not Runner.xcworkspace) > File > Project Settings > Per-User Project Settings: > Advanced. See Xcode 11 Swift Packages incompatible with "flutter build" #44811 (comment) for context.
    2. Attach ios/Runner.xcodeproj/project.xcworkspace/xcuserdata/USER.xcuserdatad/WorkspaceSettings.xcsetting
    3. Attach ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata
  2. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Feb 26, 2021
  3. ammaratef45 commented on Feb 26, 2021

    @ammaratef45
    Author

    @jmagman I've attached them in More docs section in the issue

  4. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Feb 26, 2021
  5. jmagman commented on Feb 26, 2021

    @jmagman
    Member
    	<key>BuildLocationStyle</key>
    	<string>UseTargetSettings</string>
    	<key>CustomBuildLocationType</key>
    	<string>RelativeToDerivedData</string>
    

    Hm yeah that's the problem. Can you attach your project's .metadata file so I can see what version of Flutter you were on when you generated the project?

  6. ammaratef45 commented on Feb 26, 2021

    @ammaratef45
    Author
    	<key>BuildLocationStyle</key>
    	<string>UseTargetSettings</string>
    	<key>CustomBuildLocationType</key>
    	<string>RelativeToDerivedData</string>
    

    Hm yeah that's the problem. Can you attach your project's .metadata file so I can see what version of Flutter you were on when you generated the project?

    @jmagman Where can I find that?

  7. jmagman commented on Feb 26, 2021

    @jmagman
    Member

    Where can I find that?

    It should be a file named .metadata in the root of your Flutter project. If it's missing, do you happen to remember what version of Flutter you were on when you created your project?

  8. ammaratef45 commented on Feb 26, 2021

    @ammaratef45
    Author

    @jmagman
    The file is messing but most likely it was Flutter 1.22.5 • channel stable
    The project was created by a co-worker and they didn't upgrade their flutter since creating it

  9. TahaTesser commented on Mar 1, 2021

    @TahaTesser
    Contributor

    Hi @ammaratef45
    Thanks for filing the issue

    Changed Advanced from Legacy to Xcode Default and WorkspaceSettings.xcsettings is as follows

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
    	<key>BuildLocationStyle</key>
    	<string>UseAppPreferences</string>
    	<key>CustomBuildLocationType</key>
    	<string>RelativeToDerivedData</string>
    	<key>DerivedDataLocationStyle</key>
    	<string>Default</string>
    	<key>IssueFilterStyle</key>
    	<string>ShowActiveSchemeOnly</string>
    	<key>LiveSourceIssuesEnabled</key>
    	<true/>
    	<key>ShowSharedSchemesAutomaticallyEnabled</key>
    	<true/>
    </dict>
    </plist>

    The app builds and runs after the changes

    It shouldn't be legacy but code default, in your project it shows legacy, #44811 (comment)

    flutter doctor -v
    [✓] Flutter (Channel stable, 1.22.6, on macOS 11.2.2 20D80 darwin-x64, locale en-GB)
        • Flutter version 1.22.6 at /Users/tahatesser/Code/flutter_stable
        • Framework revision 9b2d32b605 (5 weeks ago), 2021-01-22 14:36:39 -0800
        • Engine revision 2f0af37152
        • Dart version 2.10.5
    
     
    [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
        • Android SDK at /Volumes/Extreme/SDK
        • Platform android-30, build-tools 30.0.3
        • ANDROID_HOME = /Volumes/Extreme/SDK
        • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
        • All Android licenses accepted.
    
    [✓] Xcode - develop for iOS and macOS (Xcode 12.4)
        • Xcode at /Volumes/Extreme/Xcode.app/Contents/Developer
        • Xcode 12.4, Build version 12D4e
        • CocoaPods version 1.10.1
    
    [!] Android Studio (version 4.1)
        • Android Studio at /Applications/Android Studio.app/Contents
        ✗ Flutter plugin not installed; this adds Flutter specific functionality.
        ✗ Dart plugin not installed; this adds Dart specific functionality.
        • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
    
    [✓] VS Code (version 1.53.2)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.19.0
    
    [✓] Connected device (1 available)
        • Taha’s iPad (mobile) • 00008020-000255113EE8402E • ios • iOS 14.4
    
    ! Doctor found issues in 1 category.
    

    A similar issue was filed #74586

  10. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Mar 1, 2021
  11. ammaratef45 commented on Mar 1, 2021

    @ammaratef45
    Author

    @TahaTesser As I mentioned, changing to Xcode default solves it but with a clean clone it is reverted back to legacy and I have to change it again.
    That breaks my CI/CD builds as they always depend on a clean clone.

  12. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Mar 1, 2021
  13. 20 remaining items

  14. jmagman commented on Jun 2, 2021

    @jmagman
    Member

    #82576 merged

    This is available in 2.3.0-12.0.pre (currently dev channel)

  15. alex-zige commented on Jun 2, 2021

    @alex-zige

    thanks @jmagman 👍

  16. added
    P2Important issues not at the top of the work list
    and removed
    P1High-priority issues at the top of the work list
    on Jul 20, 2021
  17. TimurDyushaliev commented on Aug 26, 2021

    @TimurDyushaliev
  18. removed their assignment
    on Apr 21, 2023
  19. jmagman commented on Feb 8, 2024

    @jmagman
    Member

    Closing, legacy build locations are no longer supported by Flutter or Xcode.

  20. github-actions commented on Feb 22, 2024

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  21. locked as resolved and limited conversation to collaborators on Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listc: crashStack traces logged to the consoleplatform-iosiOS applications specificallyt: xcode"xcodebuild" on iOS and general Xcode project managementteam-iosOwned by iOS platform teamtoolAffects the "flutter" command-line tool. See also t: labels.triaged-iosTriaged by iOS platform team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions