无法为 Flutter 应用构建连接插件

Connectivity plugin fails to build for flutter app

我使用的是flutter团队提供的最新版本。连通性:^0.4.6+1 迁移到 AndroidX 支持后仍然面临这个问题。


FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'connectivity'.
> SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.

* 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 1s


The plugin connectivity could not be built due to the issue above.

更新到最新的连接插件,flutter clean 有所帮助。 ios 现在有一个问题,它有点不同,但会为此创建一个新线程。