0

I made no changes in any but once i ran the app as usual it started giving me this error

: file:///C:/src/flutter/packages/flutter_tools/gradle/src/main/kotlin/DependencyVersionChecker.kt:97:99 Unresolved reference: variants

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':gradle:compileKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
   > Compilation error. See log for more 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 1m 17s
Error: Gradle task assembleDebug failed with exit code 1

I have tried reinstalling the sdk and updating visual studio code also I have tried flutter clean and then flutter pub get but the issue is still there.

I even made another project and shifted my lib folder there but the issue persists and the other apps also now won't run suddenly.

1
  • Have you tried to run "flutter clean"? Commented Jul 24 at 20:35

1 Answer 1

0

In Visual Studio Code, open terminal and write "cd android" to enter android folder. Then clear the gradle cache by writing "./gradlew clean". Then try to build it again using "./gradlew build".

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.