Android - delete R.java file when import google-play-services-lib

I am working on a project in which I want to show a map, for which I want to add google-play-service-lib , but when I add it, my R.java files are deleted and not restored.

I tried adding google-play-service-lib to the build path. After adding everything goes fine. But when I run the project, it gives an error message: java.lang.NoClassDefFoundError: com.google.android.gms.R$styleable

And when I add it to the project, R.java is deleted. I tried the number of permutations and combinations that I found on google and SO . But there is no acceptable solution that solves my problem.

Please help me with this .. !!

EDIT

 <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" > <fragment android:id="@+id/map_gle" android:layout_width="match_parent" android:layout_height="match_parent" class="com.google.android.gms.maps.SupportMapFragment"/> </RelativeLayout> 
0
source share
1 answer

make sure your Google Play services are in the same working directory and make this project a link to the original project.

  Ensure you have the latest version (v2) of the Google Play Services installed. Select Window > Android SDK Manager or run android at the command line. Scroll to the bottom of the package list and select Extras > Google Play services. The Google Play services SDK is downloaded to your computer and installed in your Android SDK environment at <android-sdk-folder>/extras/google/google_play_services/ Add the Google Play Services project into your Eclipse workspace. Click File -> Import..., select Android -> Existing Android Code into Workspace Browse to and select <android-sdk-folder>/extras/google/google_play_services/libproject/google-play-services_lib To add the dependency to Google Play Services into your project Project -> Properties -> Android -> Library, Add -> google-play-services_lib 

By providing a link you can see the importing Google play services

and even check that your Google Play services are updated by going to sdk manger ...

0
source

All Articles