简体   繁体   English

在 Windows 上设置没有 android studio 的 flutter 应用程序

[英]setup flutter app without android studio on windows

I want to create my first flutter app but the official doc says we must install android studio to run the app and test it but the android studio is so big and heavy and I am a web developer just trying to test my first flutter app and dont want to use the android studio.我想创建我的第一个 flutter 应用程序,但官方文档说我们必须安装 android studio 来运行该应用程序并对其进行测试,但是 android studio 又大又重,我是一名 Web 开发人员,只是想测试我的第一个 flutter 应用程序而不是想使用android studio。
any solution to run and develop an app in VS Code and windows?在 VS Code 和 Windows 中运行和开发应用程序的任何解决方案?

It is very possible to use VS Code for Flutter without having installed Android Studio, however it's a little more involved.非常有可能在没有安装 Android Studio 的情况下将 VS Code 用于 Flutter,但它涉及更多。 You'll need to download and install the Android SDK on its own, and without Android Studio you'll be missing a few things (like the UI for managing emulators, updating the SDK components, or editing assets like icons).您需要自行下载并安装 Android SDK,如果没有 Android Studio,您将缺少一些东西(例如用于管理模拟器的 UI、更新 SDK 组件或编辑图标等资产)。

I tried for a while to work without it (I'm the developer of the VS Code extensions and installing it felt like admission that there are things missing there 😄) but after a while it turned out to be easier to just install it (especially updating SDK bits).我尝试了一段时间在没有它的情况下工作(我是 VS Code 扩展的开发人员,安装它感觉就像承认那里缺少一些东西😄)但过了一段时间,结果证明安装它更容易(尤其是更新 SDK 位)。

an addition to @AbOo Saed answer, you need to install android sdks for you to begin development.除了@AbOo Saed 的回答之外,您还需要安装 android sdks 才能开始开发。 for you to be able to build your app with a custom package name run让您能够使用自定义包名称运行构建您的应用程序

flutter create --org com.packagename -i swift -a kotlin --description ' App Description' your_app_name

下载dart 语言 => https://dart.dev/下载flutter => https://flutter.dev/flutter 和 dart 扩展到 vs 代码

follow this medium article and install and follow every step.遵循这篇中等文章并安装并遵循每一步。
new version of flutter needs android sdk 28 or higher so chnage sdkmanager “system-images;android-27;default;x86_64” to sdkmanager “system-images;android-28;default;x86_64” and other 27 to 28 too.新版本的 flutter 需要 android sdk 28 或更高版本,因此将sdkmanager “system-images;android-27;default;x86_64”更改为sdkmanager “system-images;android-28;default;x86_64”以及其他 27 至 28。
after installation, if you cant connect to the emulator try command emulator -avd emulator-name for example emulator -avd nexus and see whats the problem.安装后,如果您无法连接到模拟器,请尝试命令emulator -avd emulator-name例如emulator -avd nexus并查看问题所在。 for me it was对我来说是

Incompatible HAX module version 3,requires minimum version 4不兼容的 HAX 模块版本 3,需要最低版本 4

so i download and install latest version from here then its work perfectly所以我从这里下载并安装最新版本然后它完美地工作

You can always make flutter apps in Visual Studio Code using Flutter and Dart plugins, but to run them you'll need an emulator.您始终可以使用 Flutter 和 Dart 插件在 Visual Studio Code 中制作 Flutter 应用程序,但要运行它们,您需要一个模拟器。 This need can be eliminated by using an actual device connected via USB.使用通过 USB 连接的实际设备可以消除这种需求。 But what about other things like build tools, android SDK, CLI tools, etc. Things that aren't easy to get separately.但是其他的东西呢,比如构建工具、android SDK、CLI 工具等等。那些不容易单独拿到的东西。 Android studio saves you all this trouble. Android Studio 为您省去所有这些麻烦。

My suggestion is to have Android Studio installed on the sidelines.我的建议是在场边安装 Android Studio。 Do all your work in VSCode, many people are happy with that.在 VSCode 中完成所有工作,很多人对此感到满意。 To occasionally configure stuff the studio will be helpful.偶尔配置工作室会有所帮助。

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

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