I\'m new to Android Studio and while creating a new project it stuck at resolving dependencies :app:_debugCompile
.
I waited for sometime and even tried
Try looking at Gradle debug output. (My guess is IDE is not able to get to jcenter repository). Here is what you can try.
How does your module "build.gradle" look like? you might want to add "mavenCentral()" under repositories block. (assuming you have dependencies that are found there)
I solved this by going to AppName\app -> open build.gradle and replace the dependencies part with:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:25.1.0'
compile 'com.android.support:design:25.1.0'
compile 'com.android.support:multidex:1.0.0'
}
You'll have to do this for every app you create but after this they will load fine.
I do it this way:
In my case, I imported the project which was created by someone else. For me it was proxy set in gradle.properties file of the project. I commented below lines in gradle.properties and it worked fine.
#systemProp.https.proxyPort=8080
#systemProp.http.proxyHost=10.10.11.12
#systemProp.https.proxyHost=10.10.11.12
#systemProp.http.proxyPort=8080
I had the same issue, and I just let it go for 30 mins. Then it started working after that.
It was also resolving other stuff after "_debugCompile".
Cancel the Gradle build when its taking long time.
Check the HTTP proxy settings in File-> Settings-> Appearance & Behavior -> System Settings -> HTTP Proxy. Verify using "Check connection"
If fine, remove the android test compile and/or unit test build from app/build.gradle file e.g remove the below line
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { exclude group: 'com.android.support', module: 'support-annotations' })
resolving dependencies is taking too much time because it is trying to download some files to build successfully. With proper bandwidth, it can be removed. Here, I am discussing what I did with my project on the android studio:
1. Open the terminal in Android Studio.
2. Move to your project's android folder with the help of terminal command cd
it might be something like: YourProjectNameHere\
, if you are working on flutter then this might be like: YourProjectNameHere\android\
.
3. run the grdlew by typing gradlew
in the terminal.
4. Let it finish or abort with some error. Don't interrupt the process. You can see on your terminal that few files are downloading.
5. if again there is an error, read the error carefully, you can figure it out where is the error and what's the error. And go to step 3. until it finishes build successfully.
P.S.: if gradlew
command is unable to download few files due to some reason, you can download it manually by using your favourite browser.