“Flutter: Dart语言在Android Studio创建新项目时不显示”

huangapple go评论72阅读模式
英文:

Flutter: Dart language is not showing up when creating a new project in Android Studio

问题

以下是翻译好的内容:

免责声明:我对这方面非常陌生;我第一次尝试应用程序开发,所以请在批评我之前请注意这一点,如果我漏掉了一些明显的东西,哈哈。

所以,我刚刚开始观看这个 使用Android Studio作为IDE的Flutter教程系列。我已安装了Flutter插件以及Dart插件,但出于某种原因,当我尝试创建新项目时,可用语言中缺少Dart:

单击可用语言面板侧边的加号按钮将提供更多需要安装以操作的语言插件(其中没有dart)

此外,在左侧有一个Dart生成器:它只显示给我这个。我已经对那里的目录进行了一些调整,但它一直说找不到相关的文件,尽管我已安装了Dart插件。

我进行了一些Google搜索并查看了Android Studio中已安装的插件,Dart插件和Flutter一起都在那里。我还尝试寻找其他教程,但教程结构以及Android Studio的结构和UI中的一些奇怪变化,我想要坚持我找到的这个系列。

任何帮助都将不胜感激,如果这是一个新手问题,我深感抱歉。

英文:

Disclaimer: I'm extremely new to this stuff; I'm trying out app development for the first time so please acknowledge that before flaming me if I'm missing something obvious lol.

So I've just started watching this tutorial series on Flutter that uses Android Studio as the IDE. I've installed the Flutter plugin aswell as the Dart plugin but for some reason when I try to create a new project, Dart is missing from the available languages:

Clicking the plus button on the side of the available languages panel will give me more lang plugins that I need to install to operate (dart not being one of them).

Also, theres a Dart generator on the left:It just shows me this. I've messed around a bit with that directory up there but it keeps saying that the relevant file wasn't found, even though I have the Dart plugin installed.

I've done a few google searches and looking at my installed plugins in Android Studio, the Dart plugin is there and installed along with Flutter. I also tried looking for other tutorials but odd things here and there in the structure of the tutorials along with the Android Studio structure and UI have changed and I'd like to be able to stick to the series I found.

Any help is appreciated and I apologize if this is a noob thing to ask.

答案1

得分: 1

我面临了同样的问题,并按照以下步骤解决了它,我希望对其他人也有所帮助。

  • 下载Flutter SDK
  • 安装Flutter和Dart插件,然后重新启动Android Studio
  • 在Android Studio中设置Flutter SDK路径(你可以在创建新的Flutter项目时设置)
  • 打开任何之前的Flutter项目(如果你没有的话,可以从GitHub下载任何开源项目)
  • 当你打开旧项目时,会弹出一个Dart未配置的提示框
  • 点击提示框中的Dart设置按钮
  • 设置Dart路径,并允许在同一个项目中启用Dart

方法2:
设置Dart SDK路径。

  • 创建新的Flutter项目
  • 选择Dart并设置Dart SDK路径
英文:

I was facing same issue and followed following steps to resolve and I hope it'll help for someone else too.

  • Download Flutter SDK
  • Install Flutter and Dart plugin then restart the Android studio
  • Set flutter SDK path in android studio(you can set while creating new flutter project)
  • Open any previous flutter project (download any open source project from gitHub if you don't have any)
  • When you open old project there will be popup for dart not configured
  • Click on Dart setting button from that popup
  • Set dart path and allow enable dart for same project
    “Flutter: Dart语言在Android Studio创建新项目时不显示”

Method 2:
Set Dart SDK path.

  • Create new flutter project
  • select Dart and set dart SDK path
    “Flutter: Dart语言在Android Studio创建新项目时不显示”

答案2

得分: -1

  1. 确保您已安装并配置了Dart和Flutter SDK
    (您可以通过在命令提示符中运行以下命令来检查:flutter doctor)。

  2. 然后,在创建新项目时,请确保选择正确的项目类型。
    在Android Studio中,选择“Flutter”作为项目类型,而不是“Android”。
    这将确保为您的项目提供Dart语言支持。

  3. 如果这不起作用,有时候Android Studio的缓存可能会导致意外行为。
    尝试通过转到“文件” > “使缓存无效/重新启动”,然后选择“使缓存无效并重新启动”来清除缓存。
    这将清除缓存并重新启动Android Studio。

英文:
  1. Make sure that you have installed and configured Dart & Flutter SDK
    (You can check this by running the following command in Command
    Prompt- Administrator: flutter doctor).

  2. Then make sure the Flutter project type is selected When creating a
    new project, make sure you select the correct project type. In
    Android Studio, choose "Flutter" as the project type, not "Android."
    This ensures that Dart language support is available for your
    project.

  3. If that doesn't work Sometimes, Android Studio cache can cause
    unexpected behavior. Try clearing the cache by going to "File" >
    "Invalidate Caches / Restart" and then select "Invalidate and
    Restart." This will clear the cache and restart Android Studio.

答案3

得分: -2

打开新的Flutter项目。我认为Dart已经存在。尝试运行默认的Flutter应用程序。它应该可以工作。

英文:

Open new project with Flutter. I think Dart is already there. Try to run the default flutter app. It should work.

huangapple
  • 本文由 发表于 2023年5月21日 07:40:29
  • 转载请务必保留本文链接:https://go.coder-hub.com/76297752.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定