简体   繁体   中英

Flutter connectivity:compileDebugJavaWithJavac error

I have a Flutter project and it's work on other systems successfully. now I'm new in the team and today I pulled the project on my 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. 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.

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

在此处输入图片说明

在此处输入图片说明

anybody can help me!?

Maybe the error is related to your SDK version. Please upgrade it.

In your android/build.gradle File

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.

distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip

Taken from 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

Here is the installation guide

If not then please check the issues thread as above, most probably it is an issue with your setup

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM