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

bogh5gae  于 2023-04-03  发布在  Flutter
关注(0)|答案(2)|浏览(383)
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.
3ks5zfa0

3ks5zfa01#

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

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

此代码将为您停止问题,并将停止获得这些警告,如错误消息。

kb5ga3dv

kb5ga3dv2#

该错误消息意味着,您的Java代码有警告。由于-Werror标志,它成为一个错误。
警告说,您的Java目标版本太旧。
因此,您可以升级该版本。或者删除-Werror

相关问题