Flutter:当我试图运行我从github克隆的Flutter应用程序,但构建失败时,有人能告诉我如何解决吗


warning: [options] source value 7 is obsolete and will be removed in a future release
warning: [options] target value 7 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
error: warnings found and -Werror specified
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':connectivity:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

将其添加到app/build.gradle文件中android {部分下

lintOptions {
disable 'InvalidPackage'
warning("all")
checkReleaseBuilds false
}

此代码将为您停止该问题,并将停止获得类似错误消息的警告。

这个错误消息意味着,您的java代码有警告。并且由于-Werror标志,它变为错误。

警告说,您的java目标版本太旧了。

因此,您可以升级该版本。或者,移除-Werror

相关内容

最新更新