Android 如何修复颤振项目中的多SDK路径警告

Android 如何修复颤振项目中的多SDK路径警告,android,flutter,Android,Flutter,我更改了sdk文件,然后当我运行项目时,它会显示此错误 Warning! The 'flutter' tool you are currently running is from a different Flutter repository than the one last used by this package. The repository from which the 'flutter' tool is currently executing will be used instead.

我更改了sdk文件,然后当我运行项目时,它会显示此错误

Warning! The 'flutter' tool you are currently running is from a different Flutter repository than the one last used by this package. The repository from which the 'flutter' tool is currently executing will be used instead.
  running Flutter tool: C:\Users\LENOVO\Desktop\flutter
  previous reference  : C:\src\flutter
This can happen when you have multiple copies of flutter installed. Please check your system path to verify that you are running the expected version (run 'flutter --version' to see which flutter is on your path).

确保您指定了正确的路径我认为在您的情况下,它在桌面上,但我建议将它从桌面上移动,但这是您的电话,或者从其他安全的地方提取,然后指定该路径,或者您可以使用设置的环境变量全局指定正确的路径

Android Studio中的菜单>文件>设置…>语言与框架>颤振>颤振SDK路径:(更改路径:C:\Users\LENOVO\Desktop\颤振)

使用环境变量全局设置颤振路径

  • 打开开始菜单并键入
    env

  • 打开并编辑系统环境变量

  • 点击环境变量

  • 在系统变量下,选择路径,然后单击编辑

  • 单击“新建”,然后粘贴此行
    C:\Users\LENOVO\Desktop\flatter\bin

  • 按Ok,然后重新启动计算机,这不是必需的,只是以防万一

  • 注意:确保路径正确


    在运行flutter clean之后,然后运行flutter doctor,它将返回一些详细信息,当所有内容都标记好后,就可以开始了

    这不是一个错误,而是一个警告,提醒您当前有两个版本的flutter SDK。如果不需要旧版本,可以将其删除,警告将消失(不要忘记更新系统路径)。否则,正如警告所说,通过检查系统路径,确保您正在运行预期版本。

    我可以在哪里运行Flatter clean,因为在android studio的终端中显示:“Flatter”不被识别为内部或外部命令、可操作程序或批处理文件@您需要在windows@LailaMattarI中的环境变量
    中设置颤振安装路径,并按照steps@LailaMattarwhen我删除了旧版本项目每次都会出错您在哪里更新了系统路径?并在项目设置中指定正确的SDK路径@莱拉玛塔