I am working on a project in android studio that requires the use of google play services. I understand that I need to install the SDK, but as seen in the photo, I am prompted with a link to download the repositories that I must use. Unfortunately, this link does not work and I cannot download the repositories, therefore my gradle will not sync. What should I do?
Asked
Active
Viewed 4,612 times
2
-
Could you replace image with your actual code? – Doron Yakovlev Golani Mar 01 '17 at 21:10
-
Fixed it so the image appears, the gradle build error is the bigger problem – Dylan Zeller Mar 01 '17 at 21:20
-
did you update android sdk tools before doing this ? because I had the same issue just after the update. so does this link http://stackoverflow.com/questions/42549667/androidstudio-failed-to-sync-gradle-project-failed-to-find-target-google-inc and several others i found online – Dany Y Mar 02 '17 at 21:22
2 Answers
2
I have a feeling you are using the wrong API - for app indexing you should be using Firebase App indexing.
Hence, according to the documentation your gradle file should look somewhat like this:
apply plugin: 'com.android.application'
android {
// ...
}
dependencies {
// ...
compile 'com.google.firebase:firebase-core:10.2.0'
// Getting a "Could not find" error? Make sure you have
// the latest Google Repository in the Android SDK manager
}
// ADD THIS AT THE BOTTOM
apply plugin: 'com.google.gms.google-services'

Doron Yakovlev Golani
- 5,188
- 9
- 36
- 60
-
I am specifically using google authentication and google calendar API's – Dylan Zeller Mar 01 '17 at 21:50
-
I am not sure that what you are trying to do is possible. According to https://developers.google.com/android/guides/setup appindexing is not one of the possible options for you to import in gradle. – Doron Yakovlev Golani Mar 01 '17 at 22:13
1
Two ways to solve this problem:
- Open SDK manager and install (from extras) play services. Install or update
- Press the "Install repository and sync project" in the Gradle build error
Both does the same thing: Install the repository required for app indexing.
Also see:
-- UPDATE --
After searching a lot, I cannot find anything on app indexing with that package name on the internet or on android developers. I started expanding the search and I came over this. A lot of the google cloud services were moved to Firebase. So, in theory, for it to work you have to use Firebase to access the dependency. And the dependency is different from the one you are currently using(see the last link above)
-
I uninstalled and reinstalled google play services and I am still having the same issue... The link that it provides in gradle build error does not do anything – Dylan Zeller Mar 01 '17 at 21:19
-
I tried all the fixes and I am still seeing an error for missing repositories – Dylan Zeller Mar 01 '17 at 21:49
-
The whole google play services folder was being installed, when many of the plugins wee unnecessary – Dylan Zeller Mar 03 '17 at 16:47