0

So I just installed the latest version of Android Studio and trying to simply get the Google Play app working on my Google Pixel XL. I went ahead to my app/build.gradle file and added the following line:

compile 'com.google.android.gms:play-services:10.2.0'

So that it looks like this:

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:25.3.0'
    compile 'com.google.android.gms:play-services:10.2.0'
}

I synced my gradle. I also went to Tools -> Android -> SDK Manager. Once the window opened, I went to SDK Manager (already highlighted) -> SDK Tools (tab), and under Support Repository, I see that Google Repository is already selected and Installed. I also selected "Google Play Services" a little further up.

The minute I started my AVD, I tried to go to the app drawer and I still did not see Google Play in there.

Can someone please tell me what I'm missing here? It seems like these steps work for everyone, but obviously either I'm missing something, or there's some update that requires an extra step or something.

I also restarted Android Studio and tried to find Google Play in my AVD with no success.

LewlSauce
  • 5,326
  • 8
  • 44
  • 91
  • Add `apply plugin: 'com.google.gms.google-services'` at the end of your **app/build.gradle** and `classpath 'com.google.gms:google-services:3.0.0'` in the **project/build.gradle:buildscript.dependencies** tag – Hassan Jamil Mar 15 '17 at 06:25
  • When I try syncing the gradle after adding the first line at the end of build.gradle, it says "Plugin with id 'com.google.gms.google-services' not found'. I think it may be solved by applying your second line -- but I apologize, where is project/build.gradle:buildscript.dependencies? Sorry for my ignorance. – LewlSauce Mar 15 '17 at 06:26
  • Yes exactly, you need to add plugin by adding `classpath 'com.google.gms:google-services:3.0.0'` to your **project/build.gradle** in **buildscript.dependencies{ }** scope – Hassan Jamil Mar 15 '17 at 06:28
  • Thanks. I've added the necessary command to both files. However, I now get another error stating: Execution failed for task ':app:processDebugGoogleServices". File google-services.json is missing. The Google Services Plugin cannot function without it. – LewlSauce Mar 15 '17 at 06:30
  • 1
    The services you are using from google play services needs some configurations defined in **google-services.json**, to get this file you can get help from this link [Where do I get a google-services.json](http://stackoverflow.com/a/34368739/3819836) – Hassan Jamil Mar 15 '17 at 06:35
  • Gotcha. So I've added the google-services.json file, the two lines you mentioned, synced gradle, and started AVD. Still no Google Play app. It looks like I'm still either missing or misunderstanding something. I really appreciate your help thus far though. – LewlSauce Mar 15 '17 at 06:44
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/138083/discussion-between-hassan-jamil-and-lewlsauce). – Hassan Jamil Mar 15 '17 at 07:31
  • The thread may help you do this [Android Studio emulator does not come with Play Store for API 23](http://stackoverflow.com/q/34291902/3819836) – Hassan Jamil Mar 15 '17 at 07:40

0 Answers0