如何在Android Studio和IntelliJ中安装Flutter和Dart?

8

我的安装遇到了问题。当我运行flutter doctor时,出现以下情况:

[✓] Flutter (Channel beta, v0.4.4, on Mac OS X 10.11.6 15G19009, locale en)
    • Flutter version 0.4.4 at /Users/divyakrishnan/Development/flutter
    • Framework revision f9bb4289e9 (11 days ago), 2018-05-11 21:44:54 -0700
    • Engine revision 06afdfe54e
    • Dart version 2.0.0-dev.54.0.flutter-46ab040e58

[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
    • Android SDK at /Users/divyakrishnan/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-27, build-tools 27.0.3
    • Java binary at: /Applications/Android Studio 3.0 Preview.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b01)
    • All Android licenses accepted.

[!] iOS toolchain - develop for iOS devices
    ✗ Xcode installation is incomplete; a full installation is necessary for iOS development.
      Download at: https://developer.apple.com/xcode/download/
      Or install Xcode via the App Store.
      Once installed, run:
        sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
    ✗ libimobiledevice and ideviceinstaller are not installed. To install, run:
        brew install --HEAD libimobiledevice
        brew install ideviceinstaller
    ✗ ios-deploy not installed. To install:
        brew install ios-deploy
    ✗ CocoaPods not installed.
        CocoaPods is used to retrieve the iOS platform side's plugin code that responds to your plugin usage on the Dart side.
        Without resolving iOS dependencies with CocoaPods, plugins will not work on iOS.
        For more info, see https://flutter.io/platform-plugins
      To install:
        brew install cocoapods
        pod setup

[✓] Android Studio
    • Android Studio at /Applications/Android Studio 3.0 Preview.app/Contents
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b01)

[!] IntelliJ IDEA Community Edition (version 2018.1.4)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
    • For information about installing plugins, see
      https://flutter.io/intellij-setup/#installing-the-plugins

[!] Connected devices
    ! No devices available

我在Android Studio 3.0和IntelliJ中没有看到Flutter或Dart插件。


1
打开 Android Studio,进入“文件”->“项目”->“插件”,在那里安装 Flutter 插件。 - Blasanka
并且您不需要同时使用IDEA和前往Flutter doctor(iOS工具链)提供的链接。 - Blasanka
7个回答

6
插件不会默认安装在Android Studio或IntelliJ中。您需要使用此页面上的说明自行安装插件:
安装Flutter和Dart插件
Flutter支持两个插件: - Flutter插件支持Flutter开发人员工作流程(运行、调试、热重载等)。 - Dart插件提供代码分析(代码验证、代码完成等)。
要安装这些插件,请按照以下步骤操作: 1.启动Android Studio。 2.打开插件首选项(macOS上为“Preferences>Plugins”,Windows和Linux上为“File>Settings>Plugins”)。 3.选择“浏览存储库…”,选择Flutter插件并单击“安装”。 4.在提示安装Dart插件时,单击“是”。 5.在提示时单击“重新启动”。

4

请按照以下步骤操作:

  1. 打开插件页面。
    Plugin

  2. 浏览仓库。
    Click Browse repositories

  3. 搜索flutter。
    Search flutter

  4. 点击安装(会弹出一个有关dart依赖的对话框,点击Yes)。
    Agree to install dart

  5. 安装完成后,重新启动Android Studio。
    Restart android studio

希望这有所帮助。


2

enter image description here

我遇到了同样的问题,以下是解决方法的步骤(安装Flutter和Dart插件):
  1. 启动Android Studio。
  2. 打开插件首选项(Configure > Plugins),在v3.6.3.0更高版本中为如此。

enter image description here

注:在v3.6.3.0之前,应按照以下步骤进行操作:打开插件首选项(macOS为“Preferences > Plugins”,Windows和Linux为“File > Settings > Plugins”)。 3. 选择Flutter插件并单击“安装”。

enter image description here

在提示安装 Dart 插件时,点击

enter image description here

在提示时,点击重新启动
运行 flutter doctor 命令。你应该能够得到这样的输出:

enter image description here


0

在编程中,最重要的一点就是始终以管理员身份运行你的IDE,例如Android等,这样可以避免出现多种错误。


0

在Android Studio中安装Flutter和Dart插件非常容易--按照以下步骤进行安装:

  1. 点击Configure --> Plugins
  2. 从搜索框中浏览Flutter存储库
  3. 点击install按钮
  4. 从Alter提示中点击Yes以安装Dart插件
  5. 完成所有过程后,重新启动Android Studio以激活插件

欲了解更多信息请单击此处查找详细步骤和图形界面


0

我自己找到了这个解决方案,所以没有证明或详细信息的链接。

我尝试通过Android Studio(文件-设置-插件-市场)安装Dart和Flutter插件。每次安装后都会显示重新启动IDE。重启后,Android Studio每次都会显示禁用Flutter插件或安装Dart。 经过多次尝试(通过上述选项安装Dart),我进入了

*\.AndroidStudio4.0\system\plugins

flutter-intellij.zipDart-*.*.zip 文件复制到

*\.AndroidStudio4.0\config\plugins

我刚刚解压了这两个文件(使用了“提取到此处”选项),然后启动了Android Studio,错误消失了,并且Android Studio显示了一些数据收集信息。

现在我可以看到文件 -> 新建 -> 新建Flutter项目...


0

以下是安装Flutter和Android Studio的步骤:

1.Go to Settings->Plugin->Install Flutter and Dart->Restart Android Studio
2.Download  the flutter sdk
3.In the environment Variable->User Variable->
ANDROID_HOME F:\AndroidSDK(Paste your Android SDK Path)
Path:F:\AndroidSDk;(Paste your Android SDK Path)
     c:\ProgramFiles\Java\jdk\1.8.0_20\bin;(Paste your jdk Path)
     c:\Users\Desktop\flutter\bin;(Paste your Flutter SDK Path)
4.Git install at c:\ProgramFiles\Git
5.Open Gitbash
$flutter doctor
$flutter doctor --android-licenses
Accept the licences Y Y Y Y
Make sure your Device should be connected your PC   

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接