Skip to content

Consider adding DerivedData and org.swift.swiftpm to flutter clean command to fix SPM build #183226

Description

@Gustl22

Use case

Recently we upgraded from firebase_core 4.4.0 to 4.5.0. And we got the error on macos:

Failed to resolve dependencies Dependencies could not be resolved because 'firebase_crashlytics' depends on 'flutterfire' 4.5.0-firebase-core-swift and 'firebase_analytics' depends on 'flutterfire' 4.4.0-firebase-core-swift.

I tried everything:

  • flutter clean
  • removing build folder
  • removing temporary folders in ios
  • repair flutter packages cache
  • Reset package caches in XCode

Seemingly nothing worked.

Others had this problem, too, and I suspect the problem will appear on every firebase_core upgrade and their according packages:
firebase/flutterfire#17980
firebase/flutterfire#17962

I haven't tried to reproduce, but I will later (as its probably hard to reproduce), if it is feasable to add.

Proposal

I propose to add these command to the flutter clean command. So package maintainers don't need to bother searching how to resolve build issues:

rm -rf ~/Library/Developer/Xcode/DerivedData/Runner-*
rm -rf ~/Library/Caches/org.swift.swiftpm

help: 'When cleaning Xcode schemes, clean only the specified scheme.',

Sorry for the vague feature request. I just want to write it down to help others and probably get more cases, where this can be useful, as I suspect most of people just do not write an issue, and go on after finding this:
firebase/flutterfire#17962 (comment)

Also by far not everyone uses SPM yet, so I suspect there will be more which are faced with this issue in the future.
The reason might also have to do how Firebase handles its dependencies, but I find it reasonable to have a way to get rid of all potentional pitfalls, which hinders on building successfully.

Edit: this happened on an ios build

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work listc: proposalA detailed proposal for a change to Flutterplatform-macosBuilding on or for macOS specificallyteam-iosOwned by iOS platform teamtoolAffects the "flutter" command-line tool. See also t: labels.triaged-iosTriaged by iOS platform team

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions