Mehrdad
Mehrdad

Reputation: 1637

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.

Compilation failed; see the compiler error output for details.

BUILD FAILED in 12s Exception: Gradle task assembleDebug failed with exit code 1

enter image description here

enter image description here

anybody can help me!?

Upvotes: 0

Views: 4484

Answers (3)

gtxtreme
gtxtreme

Reputation: 3606

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

Upvotes: 0

Imran Sk
Imran Sk

Reputation: 327

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

Upvotes: 0

Justin Paul
Justin Paul

Reputation: 1

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

Upvotes: 0

Related Questions