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
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.
try this algorythm:
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
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.
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.