简体   繁体   English

在 windows 上没有 android 工作室运行 flutter 时出现问题

[英]Problem in running flutter without android studio on windows

i want to try android coding without android studio.我想在没有 android 工作室的情况下尝试 android 编码。 i installed android command line tools and have android-sdk platforms like this.i also installed vs code.我安装了 android 命令行工具并拥有像这样的 android-sdk 平台。我还安装了 vs 代码。 and flutter as the official docs says.和官方文档所说的 flutter 。 but i have this problem:但我有这个问题:

在此处输入图像描述

在此处输入图像描述

i also changed the system environment variables.我还更改了系统环境变量。

this is the path of the android command line tools这是 android 命令行工具的路径

在此处输入图像描述

and this is the system environment variables:这是系统环境变量:

在此处输入图像描述

this is the platforms folder:这是平台文件夹:

在此处输入图像描述

where is my mistake?我的错误在哪里?

So it seems like platforms-28 is installed and i believe that it is, and flutter it detecting the folder and telling you that it knows, so the enviroment variable it's also set.因此,似乎已安装了platforms-28,并且我相信它已安装,并且 flutter 它检测到文件夹并告诉您它知道,因此还设置了环境变量。

When this happens to me i do the following:当这种情况发生在我身上时,我会执行以下操作:

Add the android folder to PATH as well.将 android 文件夹也添加到 PATH 中。

Restart the pc[the enviroment variables are kinda weird if i don't do that]重启电脑[如果我不这样做,环境变量有点奇怪]

delete the android-28, the platform tools folder and do and the build tools[wich you don't even have there], and go to my android/tools/bin [in your case is only tools/bin ] in the command line and launch a whole new sdkmanager "platform-tools" "platforms;android-28" "build-tools;29.0.0"删除 android-28,平台工具文件夹和构建工具 [你甚至没有那里],和 go 到我的 android/tools/bin [在你的情况下只有 tools/bin] 在命令行并启动一个全新的sdkmanager "platform-tools" "platforms;android-28" "build-tools;29.0.0"

oh and then i sdkmanager --licenses to validate all.哦,然后我sdkmanager --licenses来验证所有内容。

then restart again just in case然后重新启动以防万一

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM