K.Nehe
K.Nehe

Reputation: 454

Flutter Initializing gradle and Resolving dependencies takes a very long time

Just got started with flutter but my hello world project has not been emulated on my android device because its still initializing gradle and resolving dependencies. It has taken an hour but nothing works.my internet connection is fine and fast.Is it supposed to take long the first time or? When i run flutter doctor it says no issues found.i need help

a screen shot

Upvotes: 0

Views: 4995

Answers (3)

binarynerd
binarynerd

Reputation: 11

It's downloading your dependencies for the first time. it'll take time if you're doing for the first time. just let it complete or manually download the gradle zip mentioned in the gradle-wrapper.properties file . just copy the URL from there and hit in a browser and download it and place it in the respective folder . in my case the folder was :

C:\Users\User Name.gradle\wrapper\dists\gradle-5.6.2-all\9st6wgf78h16so49nn74lgtbb

Upvotes: 0

EngineerDanny
EngineerDanny

Reputation: 865

Now because of some caches in the system. You should go to file on the menu bar and select Invalidate caches and restart. Then wait for a while for all dependencies to be resolved. Mine below, took almost 20mins before all dependencies were resolved. enter image description here

Upvotes: 0

Hamed Waezi
Hamed Waezi

Reputation: 11

Usually the first time you are running a flutter app, some stuff like gradle Etc need to be downloaded. so if it's taking a long time it might be a result of low speed internet.

I faced it when it was going to download Gradle. So I just went to the following directory and changed the Gradle version:

Project-name => android => gradle => wrapper => gradle-wrapper.properties

Hope it helps you. good luck :D

EDIT:

I need to mention I had an older version that I used to build my projects with. if you have no version of Gradle you have to let studio download it for you.

Upvotes: 1

Related Questions