0

My Gradle project sync failed. Basic functionality (e.g. editing debugging) will not work properly.

I installed Android Studio and updated everything (3.2.1) , but whenever I create new project I get these 3 errors :

Failed to resolve: com.android.support:appcompat-v7:28.0.0

Failed to resolve: com.android.support.constraint:constraint-layout:1.1.3

Failed to resolve: com.android.support.test:runner:1.0.2

What's wrong?

Thanks in advance

Community
  • 1
  • 1
Amir Hossein
  • 45
  • 1
  • 8
  • maybe connected to : https://stackoverflow.com/questions/53691457/react-native-android-could-not-find-com-android-toolscommon/53692168?r=SearchResults#53692168 – M.Ricciuti Dec 11 '18 at 08:13

3 Answers3

1

You might need a Proxy to achieve a successful Gradle sync! Because repositories are restricted to access from IRAN. Also you can use Shecan.ir and set your dns to the ip from this site.

If it was't about your proxy access! please share complete gradle & error here

Hamed Jaliliani
  • 2,789
  • 24
  • 31
  • 1 )- Failed to resolve: com.android.support:appcompat-v7:28.0.0 //// 2) - Failed to resolve: com.android.support.constraint:constraint-layout:1.1.3 /// 3 )- Failed to resolve: com.android.support.test:runner:1.0.2 /// 4 )- Failed to resolve: com.android.support.test.espresso:espresso-core:3.0.2 – Amir Hossein Dec 17 '18 at 07:04
  • I changed VPN provider but didn't work so i Reinstall android studio , and it could download dependencies. and it work.( re installation and changing Proxy made it OK) – Amir Hossein Dec 24 '18 at 11:40
  • It'll be a much better solution to set your dns by this site : https://shecan.ir/ – Hamed Jaliliani Dec 24 '18 at 11:51
0

Please check if your build.gradle(Project) looks like this enter image description here

and if not, try to change change gradle version to be as same as on this photo. Hope this help

C. Alen
  • 184
  • 1
  • 10
0

i found some way for android studio 4.2

check bottom left step 1 : find build step 2 : you will get message sync error step 3 : message will say to install missing gradle step 4 : install it

and done , its work for me