4

Does anyone have any experience in making use of the Google play services library project in IntelliJ?

I recently purchased IntelliJ and want to make use of the Google play services library (specifically the mapping aspects of the library). In eclipse this works no problem but in IntelliJ all of the references to MapFragment etc are not being resolved.

I have done the following:

1) Imported the Google play module as a library project (marked it as a library project in the android facet)

2) Marked the google play library project as a dependency of my main application

Despite this it's not resolving the required imports.

Does anyone have any tips for how to enable the Google play services library in an IntelliJ android project?

4 Answers 4

3

http://youtrack.jetbrains.com/issue/IDEA-96525

Found the solution for folks out there.

You will need to add a dummy class to the src folder.

You'll also need to add the google-play-services.jar to your module as a jar dependency.

2

I tried a lot of suggestions on stackoverflow.com. However, I was able to get the project to build and run in IntelliJ IDEA 12.0.2 by

  1. Copying the google-play-services.jar file located within my android sdk directory to the ./libs directory in my Android project
  2. Re-importing the project (e.g., on Mac OS X, open IDEA and go to File -> Import Project...) into IntelliJ IDEA.

Follow the steps in the wizard carefully. You should be able to see that IntelliJ IDEA recognizes the google-play-services.jar archive (it's checked). This worked for me. The problem appears to be a bug.

2
  • Hello , Can you please share from where you got google-play-services.jar , I am unable to add it in eclipse... Mar 20, 2013 at 10:35
  • That works. Somehow this solution needs to be communicated to Google android folks
    – prap19
    Oct 18, 2013 at 5:44
1

The confusion here is that you need to add the google play libs as an android library project, not the JAR. You also need to make sure import a copy of the the library project, not directly out of the android sdk folder.

In your IntelliJ Project, open the Android SDK Manager in the tools/Android menu.

Scroll to the bottom of the SDK Manager and choose to install the google play sdk.

Go to the extras folder in your android sdk directory and copy google-play-services_lib folder to somewhere handy for you

Open your module settings F4, right click your module and select to add a module. Follow the guide for adding a module from existing sources.

This way, you've added the google play android library project to your project, not just the jar.

0

So the way to do this is to build goole-play-services.jar from IDEA and then include the jar file as a dependency.

This will then look as follows

2
  • What do you mean by building? We have no source? Dec 24, 2012 at 16:11
  • Yeah, how exactly did you do it?
    – adrian
    Jan 11, 2013 at 3:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.