5

When i have move my project to my laptop and import it in file/import project, Android studio alert me

project refresh failed

Error: The device is not ready

error

5 Answers 5

3

Look inside your gradle file for lines something like this (this is mine):

maven {
    url "D:/Android/sdk/extras/android/m2repository"
}

I do not have drive D:\ with Android SDK on my new laptop. That is why I met the error:

Gradle sync failed: The device is not ready
Consult IDE log for more details (Help | Show Log)

In the Android Studio's log I found the line:

Caused by: org.gradle.api.UncheckedIOException: Could not normalize path for file 'D:\Android\sdk\extras\android\m2repository'.

Hope this post will help other people to handle this error quickly.

1
  • Thank you this put me on the right track to fix a similar error (I had moved project from one machine to another with a different drive letter and signing config couldn't find the keystore). Sep 29, 2016 at 10:19
1

try this algorythm:

  1. File -> Invalidate caches / Restart
  2. Shutdown Android Studio
  3. Rename/remove .gradle folder in the user home directory
  4. Restart Android Studio let it download all the Gradle stuff it needs
  5. Gradle build success
  6. Rebuild your project
0

You should connect your android device to computer i think you have driver problem .and you should install your device driver if you use windows bellows link show you how to install driver

Manually installing Android ADB USB Driver

0

If you have implemented product flavors in a project then please check implementation and keystore path. In my case it was the reason and i have corrected keystore file path in gradle it is working fine now.

0

I had system environment variables GRADLE_HOME and GRADLE_USER_HOME set to non existings directory, which I had to remove to fix a similar issue.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.