Home > Back-end >  I'm getting this error when I tried to run main.dart on my physical android device. Please can
I'm getting this error when I tried to run main.dart on my physical android device. Please can

Time:09-22

E:\Flutter_Projects\test_project_2\android>flutter run
Changing current working directory to: E:\Flutter_Projects\test_project_2 Launching lib\main.dart on ART L28 in debug mode... Exception in thread "main" java.lang.RuntimeException: Timeout of 120000 reached waiting for exclusive access to file: C:\Users\senit.gradle\wrapper\dists\gradle-7.4-all\aadb4xli5jkdsnukm30eibyiu\gradle-7.4-all.zip at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:61) at org.gradle.wrapper.Install.createDist(Install.java:48) at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:128) at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61) Running Gradle task 'assembleDebug'... 121.2s

CodePudding user response:

try to run ./gradlew clean and ./gradlew build in your project's android directory.

CodePudding user response:

It is caused by the Gradle distribution version used. To fix this, either downgrade your Gradle version to the previous or upgrade it to the next stable one. These are the Gradle distribution versions available.

Go to

android / gradle / wrapper / gradle-wrapper.properties

and replace the current Gradle version this (or choose another from Gradle distribution)

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

  • Related