最近安装了flutter sdk、Android studio 4.1以及VSCode和Android studio的Flutter和Dart插件。
[√] Flutter (Channel stable, 1.22.3, on Microsoft Windows [Version 10.0.18363.1198], locale en-IN)
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[!] Android Studio (version 4.1.0)
X Flutter plugin not installed; this adds Flutter specific functionality.
X Dart plugin not installed; this adds Dart specific functionality.
[!] Connected device
! No devices available
! Doctor found issues in 2 categories.
Flutter Doctor, Flutter & Dart plugin not installed也提出了类似的问题,它说这是4.1版本中的一个bug,但是github repo说这个bug已经被修复,忽略了警告。
1)禁用和重新启用插件
2)重新安装插件
3)重新安装VSCode和Android Studio
4)检查插件是否安装在正确的位置
5)在其他模拟器和设备上执行
当我执行
import 'package:flutter/material.dart'; //for materials
void main() {
runApp(MaterialApp(
home: Container(
color: Colors.purple,
),
));
}
这是我在调试控制台中得到的输出:
'attrib' is not recognized as an internal or external command,
operable program or batch file.
FAILURE: Build failed with an exception.
* Where:
Script 'C:\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 677
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'cmd'' finished with non-zero exit value 1
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 28s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)
1条答案
按热度按时间bzzcjhmw1#
解决方案:
浏览到环境变量设置并更新PATH变量以包含System32文件夹的地址。
即C:\Windows\System32添加变量后,重新启动计算机。
它将修复错误。
原因:发生此问题是因为系统未找到"attrib"文件。