-
Notifications
You must be signed in to change notification settings - Fork 1
Workarounds for common issues
Common issues Flutter developers might run into and recipes how to fix or work around.
The Flutter install directory is in an inconsistent state and that causes all kinds of troubles.
-
Run the following commands in the Flutter install directory:
git clean -xfd git stash save --keep-index git stash drop git pull flutter doctor
🔥
|
The |
When a project is created with flutter create foo
several files in the ios/
and android/
sub-directories are created.
Newer Flutter versions might generate these files a bit differently and projects created with older Flutter versions might cause issues.
-
Delete the
ios/
andandroid/
directories and runflutter create .
to re-generate these directories.
🔥
|
Custom changes will be lost and need to be re-applied. This is easiest if the project is committed to a version control system like Git. |
Especially with plugin packages it was seen several times that the package in the pub cache was corrupted.
Unknown. IDEs or editors used by developers might not prevent editing plugin files and when they navigate into plugin code they might accidentally modify the code.
-
Run
pub cache repair
This might take quite some time and re-downloads every package in the cache, even outdated versions that might not be used anymore by any project on disk. -
Delete
~/.pub-cache/hosted
and/or~/.pub-cache/git
(for Git dependencies). This requires to runflutter packages get
in all active projects on your machine afterwards. -
Delete a specific package or package version. Look up the exact path in cache for a specific package in the
.packages
file of your project. For example forfirebase_auth
To fix this package deletefirebase_auth:file:///Users/someuser/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.6.6/lib/
///Users/someuser/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.6.6/
(lib/
removed) and runflutter packages get
.
In a network where the Internet can only be reached through a proxy and Flutter commands fail.
When a proxy is configured hot-reload does often not work.
Copy from the following line down
Issue description
Some workarounds for common issues with AsciiDoc on GitHub
- Home of the Wiki
- Roadmap
- API Reference (stable)
- API Reference (master)
- Glossary
- Contributor Guide
- Chat on Discord
- Code of Conduct
- Issue triage reports
- Our Values
- Tree hygiene
- Issue hygiene and Triage
- Style guide for Flutter repo
- Project teams
- Contributor access
- What should I work on?
- Running and writing tests
- Release process
- Rolling Dart
- Manual Engine Roll with Breaking Commits
- Updating Material Design Fonts & Icons
- Postmortems
- Setting up the Framework development environment
- The Framework architecture
- The flutter tool
- API Docs code block generation
- Running examples
- Using the Dart analyzer
- The flutter run variants
- Test coverage for package:flutter
- Writing a golden-file test for package:flutter
- Setting up the Engine development environment
- Compiling the engine
- Debugging the engine
- Using Sanitizers with the Flutter Engine
- Testing the engine
- The Engine architecture
- Flutter's modes
- Engine disk footprint
- Comparing AOT Snapshot Sizes
- Custom Flutter engine embedders
- Custom Flutter Engine Embedding in AOT Mode
- Flutter engine operation in AOT Mode
- Engine-specific Service Protocol extensions
- Crashes
- Supporting legacy platforms
- Metal on iOS FAQ
- Engine Clang Tidy Linter
- Why we have a separate engine repo
- Reduce Flutter engine size with MLGO
- Setting up the Plugins development environment
- Setting up the Packages development environment
- Plugins and Packages repository structure
- Plugin Tests
- Contributing to Plugins and Packages
- Releasing a Plugin or Package
- Unexpected Plugins and Packages failures