[英]Flutter connectivity:compileDebugJavaWithJavac error
I have a Flutter project and it's work on other systems successfully.我有一个 Flutter 项目,它在其他系统上成功运行。 now I'm new in the team and today I pulled the project on my PC.
现在我是团队的新成员,今天我在我的 PC 上拉了这个项目。 Unfortunately, I got an error and cant build the project.
不幸的是,我出错了,无法构建项目。
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.警告:[options] 源值 7 已过时,将在未来版本中移除 警告:[options] 目标值 7 已过时,将在未来版本中移除Xlint:-选项。 error: warnings found and -Werror specified
错误:发现警告并指定 -Werror
FAILURE: Build failed with an exception. FAILURE:构建失败,出现异常。
Compilation failed;
编译失败; see the compiler error output for details.
有关详细信息,请参阅编译器错误输出。
Try: Run with --stacktrace option to get the stack trace.尝试:使用 --stacktrace 选项运行以获取堆栈跟踪。 Run with --info or --debug option to get more log output.
使用 --info 或 --debug 选项运行以获得更多日志输出。 Run with --scan to get full insights.
使用 --scan 运行以获得完整的见解。
Get more help at https://help.gradle.org在https://help.gradle.org获取更多帮助
BUILD FAILED in 12s Exception: Gradle task assembleDebug failed with exit code 1在 12 秒内构建失败异常:Gradle 任务 assembleDebug 失败,退出代码为 1
anybody can help me!?任何人都可以帮助我!?
Maybe the error is related to your SDK version.错误可能与您的 SDK 版本有关。 Please upgrade it.
请升级它。
In your android/build.gradle File在你的 android/build.gradle 文件中
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath "com.android.tools.build:gradle:3.5.0"
...
}
}
And also add In your android/gradle/wrapper/gradle-wrapper.properties.并在你的 android/gradle/wrapper/gradle-wrapper.properties 中添加。
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip
Taken from https://github.com/flutter/flutter/issues/67996#issuecomment-707696255摘自https://github.com/flutter/flutter/issues/67996#issuecomment-707696255
It is recommended to shift to connectivity_plus
instead of connectivity
as it might not be properly supported建议改用
connectivity_plus
而不是connectivity
因为它可能不被正确支持
Here is the installation guide这是安装指南
If not then please check the issues thread as above, most probably it is an issue with your setup如果没有,请检查上面的问题线程,很可能是您的设置有问题
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.