1

Am trying to add Google+ sign in to my app, and i understand i have to add Google Play Services to my project libraries.So i followed the steps provided in this StackOverflow question, but when am done i get the error

Gradle: module 'google-play-services_lib' won't be compiled. Unfortunately you can't have non-Gradle Java module and Android-Gradle module in one project.

To show i have followed the instructions correctly, this is what i have done.

  1. I opened Project Structure.

  2. Clicked on Modules in the left tab, then the + button.

  3. Selected import modules in the drop down menu

  4. Navigated to the location of the google play services_lib folder which in my case is

    ..\sdk\extras\google\google_play_services\libproject\google-play-services_lib

  5. clicked on my project (Still in project structure) and then opened the dependencies tab on the right. Clicked the + button and from the drop down menu selected Module Dependencies and selected google-play-services_lib from the list of libraries. Then i clicked the + button again and selected jars or directories from the drop down menu and then navigated to.

...\sdk\extras\google\google_play_services\libproject\google-play-services_lib\libs\google-play-services.jar

I have tried rebuilding the project and even restarting IntelliJ, but the problem still persists.Any help?

Community
  • 1
  • 1
Ojonugwa Jude Ochalifu
  • 26,627
  • 26
  • 120
  • 132

1 Answers1

0

After conversation in comments I figure out your situation:

  1. So first remove module for google play services that you added manually.
  2. Add next line into your build.gradle inside dependencies block (took example from https://plus.google.com/+AndroidDevelopers/posts/4Yhpn6p9icf):

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

And don't forget to sync project with gradle file!

Eugen Martynov
  • 19,888
  • 10
  • 61
  • 114