Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding Google Play services version to your app's manifest?

I'm following this tutorial: https://developers.google.com/maps/documentation/android/start#overview on how to add Google Maps to an app within the Android SDK.

The only problem I seem to be having is during this bit (I've done everything else with no errors):

Edit your application's AndroidManifest.xml file, and add the following declaration within the   <application> element. This embeds the version of Google Play services that the app was compiled with.   <meta-data  android:name="com.google.android.gms.version"  android:value="@integer/google_play_services_version" />  The error is:    No resources found that match the given name (at 'value' with value '@integer/        google_play_services_version'). 

I've tried to follow this persons solution to the same problem: Google Play Services Library update and missing symbol @integer/google_play_services_version

but I'm still getting the same error. Any help please?

like image 750
Adz Avatar asked Nov 09 '13 17:11

Adz


2 Answers

It is probably that your library is not linked to project properly or that you have older google-play-services library version so conflict appears and Eclipse got stupid.. :S

No you don't need to add anything in integers.xml. When you link properly Google-play-services library to your project reference android:value="@integer/google_play_services_version" will be found and you are ready to go. When you add library to your project just do one more clean so funny Eclipse environment sweep-out things properly.

If you hardcode somewhere this number when next play version come you would need to update it. And if you forget that, you will spend time again looking for bug.. :S

Hope it helped. ;)

like image 89
Ewoks Avatar answered Oct 08 '22 22:10

Ewoks


I got the solution.

  • Step 1: Right click on your project at Package explorer(left side in eclipse)
  • Step 2: goto Android.
  • Step 3: In Library section Add Library...(google-play-services_lib)
    see below buttes

    • Copy the library project at

    <android-sdk>/extras/google/google_play_services/libproject/google-play-services_lib/

    • to the location where you maintain your Android app projects. If you are using Eclipse, import the library project into your workspace. Click File > Import, select Android > Existing Android Code into Workspace, and browse to the copy of the library project to import it.
    • Click Here For more.
  • Step 4: Click Apply
  • Step 5: Click ok
  • Step 6: Refresh you app from package Explorer.
  • Step 7: you will see error is gone.
like image 33
Vrajesh Avatar answered Oct 08 '22 21:10

Vrajesh