升级颤振后命令不起作用
Posted
技术标签:
【中文标题】升级颤振后命令不起作用【英文标题】:Command doesn't works after upgrade flutter 【发布时间】:2019-11-03 00:21:06 【问题描述】:由于min v1.5 sdk插件需要,我使用flutter升级,但是由于我不能使用命令...我没有找到bash命令,
我尝试手动下载 1.5 sdk 并替换以前的文件夹,当我使用颤振医生他说我有 1.2.1 ...我试图重新升级但我有这个错误:
Your flutter checkout has local changes that would be erased by upgrading. If you want to keep these changes, it is
recommended that you stash them via "git stash" or else commit the changes to a local branch. If it is okay to remove
local changes, then re-run this command with --force.
C:\Users\utilisateur>flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, v1.2.1, on Microsoft Windows [version 10.0.17134.829], locale fr-FR)
[√] android toolchain - develop for Android devices (Android SDK version 28.0.3)
[√] Android Studio (version 3.3)
[!] VS Code, 64-bit edition (version 1.21.1)
X Flutter extension not installed; install from
https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[√] Connected device (1 available)
! Doctor found issues in 1 category.
我试过 git clean -xfd
我有……
C:\Users\utilisateur>git clean -xfd
Unlink of file '.AndroidStudio3.3/config/plugins/Dart/lib/Dart.jar' failed. Should I try again?
(y/n) Sorry, I did not understand your answer. Please type 'y' or 'n'
Unlink of file '.AndroidStudio3.3/config/plugins/Dart/lib/Dart.jar' failed. Should I try again? (y/ngit stash save --keep-index
) Sorry, I did not understand your answer. Please type 'y' or 'n'
Unlink of file '.AndroidStudio3.3/config/plugins/Dart/lib/Dart.jar' failed. Should I try againgit stash save --keep-index
? (y/n) Sorry, I did not understand your answer. Please type 'y' or 'n'
Unlink of file '.AndroidStudio3.3/config/plugins/Dart/lib/Dart.jar' failed. Should I try again? git stash save --keep-index
(y/n) Sorry, I did not understand your answer. Please type 'y' or 'n'
Unlink of file '.AndroidStudio3.3/config/plugins/Dart/lib/Dart.jar' failed. Should I try again? (y/n)
【问题讨论】:
你可以试试下面的github.com/flutter/flutter/wiki/… 我不能,其他错误.. 为了简单起见,你能把flutter sdk解压到文件夹'c:\Flutter'然后在命令提示符下打开这个文件夹再试一次 可能只适用于新项目。试试这个***.com/a/55743938/469335 我已经创建了新项目,现在可以了,谢谢您的帮助 【参考方案1】:为简单起见,您可以将flutter sdk提取到文件夹'c:\ Flutter'然后设置路径
Windows | ios
删除您创建的旧 Flutter SDK 文件夹。然后按照步骤illustrated here 将Android Studio 指向新的Flutter SDK 安装。
【讨论】:
【参考方案2】:在我的情况下,Flutter 有未分级的更改(因为它使用 git),所以我需要存储或重置它以便能够升级它。
转到flutter的路径并:
# cd flutter_path/
git add -A
git reset --hard
您也可以使用--force
来升级它。
flutter upgrade --force
【讨论】:
你需要在你的设备上去flutter path并运行这个命令来升级。【参考方案3】:我遇到了同样的问题。这可能是因为我将 Flutter SDK 安装在 E:\ 目录而不是默认的 C:\ 目录中。 我就是这样解决的,
1:检查 Flutter Sdk 的位置。您可以通过创建“新项目->Flutter->Flutter Sdk”来执行此操作(如果您安装并配置了 Flutter Sdk,则此方法有效,如果您没有安装它,您可以单击相同的安装 Sdk 选项“新的 Project->Flutter" 窗口)。
2:然后通过转到 IDE 的右下角然后单击终端来打开终端。
3:通过键入“cd _yourSdkLocation\bin”将目录更改为 Flutter sdk 的 bin 位置。这里将“_yourSdkLocation”替换为你的flutter Sdk所在的目录地址。
4:然后运行“flutter upgrade --force”
【讨论】:
【参考方案4】:在 Android Studio 或 CMD 中打开终端并粘贴
flutter upgrade --force
【讨论】:
【参考方案5】:在终端中,使用命令
source .bash_profile
然后运行,
flutter upgrade --force
删除flutter目录的改动,会升级到最新的flutter版本
【讨论】:
以上是关于升级颤振后命令不起作用的主要内容,如果未能解决你的问题,请参考以下文章
将颤振项目发布到 Play 商店后,Firebase Auth 登录不起作用