Riju T R
Riju T R

Reputation: 13

Error while debugging first app in flutter using a real device

I'm using VS code without Android studio in Ubuntu 20.04. While running the first app in flutter in debugging mode in an real device produced this error given below. I also tried to change my JDK version but it didn't worked.

Launching lib/main.dart on Nokia 6 1 Plus in debug mode...

FAILURE: Build failed with an exception.                                

* What went wrong:                                                      
Could not initialize class org.codehaus.groovy.runtime.InvokerHelper    

* 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                                                     
Running Gradle task 'assembleDebug'...                                  
Running Gradle task 'assembleDebug'... Done                        18.3s
Exception: Gradle task assembleDebug failed with exit code 1

Please suggest a solution!

Upvotes: 1

Views: 513

Answers (1)

Bhavya Shah
Bhavya Shah

Reputation: 89

Your gradle sync has failed for some reason. Do this

  1. File > Open
  2. Navigate to your project
  3. You will see an android folder there open that as project in a new window
  4. Check the gradle sync issues and resolve those

Upvotes: 1

Related Questions