java.lang.noclassdeffounderror: com.google.android.gms.R$styleable

If you are using Intellij Idea,

  1. Select your project from project panel
  2. Hit F4 in order to open the project structure window
  3. Select Modules from left panel, then hit + button then select “import module” and navigate to “ANDROID-SDK“/extras/google/google_play_services/libproject/google-play-services_lib. By doing this this project will be added to Modules alongside with your project
  4. Select your project, then select “Dependencies” (it’s a Tab) from right panel. Click + button then “3 Module dependencies…” and select “google-play-services_lib”.
  5. Click + button again then “1 jars or directories…” and navigate to “/libs” folder in the above path and select “google-play-services.jar”.
  6. Click ok and close project structure window.

Note: Make sure you have not added “google-play-services_lib” project as library in “Libraries” (left panel under Modules). If you have, you can go to “Libraries and simply remove it. Google Play Library Should Not Appear In Libraries.

Note 2: You can copy the whole google-play-services_lib directory to your own project if you wish to have it in version control or similar.

Leave a Comment