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.
// TODO
Unclear
git clean -xfd git stash save --keep-index git stash drop git pull flutter doctor
[!CAUTION] The
git stash drop
command drops customizations you might have made to the Flutter installation.
// TODO
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.
ios/
and android/
directories and run flutter create .
to re-generate these directories.[!CAUTION] 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.
Usually syntax errors at build time about code in dependencies.
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 run flutter 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 for firebase_auth
firebase_auth:file:///Users/someuser/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.6.6/lib/
To fix this package delete ///Users/someuser/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.6.6/
(lib/
removed) and run flutter packages get
.
In a network where the Internet can only be reached through a proxy and Flutter commands fail.
// TODO
Proxy setting incomplete or invalid.
(none yet)
When a proxy is configured hot-reload does often not work.
// TODO
Proxy setting incomplete or invalid. Localhost is redirected to the proxy.
NO_PROXY=127.0.0.1
Copy from the following line down
Issue description
Explain seen symptoms
Explain what causes this issue
Some workarounds for common issues with AsciiDoc on GitHub