flutter常见错误

  1. FAILURE: Build failed with an exception.
FAILURE: Build failed with an exception.

* What went wrong:
Could not receive a message from the daemon.

* 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
Exception: Gradle task assembleDebug failed with exit code 1

flutter常见错误_第1张图片解决办法:
如果使用的是win10 电脑的,先检查一下是否开启了电脑的热点,将热点关闭之后,将 Android studio重启运行就可以解决。

如果您使用的是 Windows 10,并且还使用 VMware 或最近下载了它,这是我的解决方案:

  1. 打开任务管理器。
  2. 终止有关 VMware 服务的所有内容。

可以参考:

https://stackoverflow.com/questions/49609313/could-not-receive-a-message-from-the-daemon

  1. 在用命令添加flutter 第三方包时,出现 Expected to find project root in current working directory.
    flutter常见错误_第2张图片解决办法:
    切换到项目的位置,如:我的项目在E:\smartcity\
    要切换到该项目下才能运行该命令。

怎么切换?:
1.切换到C盘根目录
打开终端cmd后,输入cd C:\(一定要加上后面的反斜扛)
2.切换到C盘子目录
打开终端cmd后,输入cd C:\dir1(切换到C盘下目录dir1)
3.切换到其他盘根目录
打开终端cmd后,输入D:(不需要加cd,一定不要加反斜扛)
4.切换到其他盘子目录
打开终端cmd后,先切换到根目录,再使用cd命令切换到子目录:cd\path

你可能感兴趣的:(flutter,android,studio,android)