Google Play Services Library update and missing sy

2019-01-01 12:28发布

When upgrading my project to the latest version of Google Play Services (v4.0, released on Halloween 2013), you are now supposed to add a new tag into the AndroidManifest.xml file.

<meta-data
    android:name="com.google.android.gms.version"
    android:value="@integer/google_play_services_version" />

Unfortunately, when I try doing that, I then get this compile error:

android-apt-compiler: /blahblah/AndroidManifest.xml:409: error: Error: No resource found that matches the given name (at 'value' with value '@integer/google_play_services_version').

I can then navigate to the file at google-play-services_lib/res/values/version.xml and view the raw integer for that symbol:

<integer name="google_play_services_version">4030500</integer>

And then insert it back into my AndroidManifest.xml:

<meta-data
    android:name="com.google.android.gms.version"
    android:value="4030500" />

Doing this works absolutely fine and I can then compile and run the project and app just fine. But it's definitely an undesirable fix with obvious upgradability issues.

Any ideas?

24条回答
时光乱了年华
2楼-- · 2019-01-01 12:38

Below are the main actions which will avoid a lot of errors when using Google play service Lib:

  1. Make sure to copy the lib project to the Eclipse projects workspace.
  2. Target SDK for Google play service lib project should be "Google
  3. API" 3- Meta data should be added to manifest file.
  4. Your project target SDK should be 17 unless you've completely updated to 19, because in some cases 19 not working well.
查看更多
临风纵饮
3楼-- · 2019-01-01 12:39

When not using an IDE, but using command line builds (using ant and ndk-build), this is how to solve it:

Install all the req'd parts with 'android' command. Then have a copy of google-play-service_lib/ in your project root. Edit project.properties to include this line:

android.library.reference.1=./google-play-services_lib
查看更多
只靠听说
4楼-- · 2019-01-01 12:41

I had same issue, the version.xml file was not in google-play-services_lib. Just start you sdk manager and accept the update especially the things related to "extras".

查看更多
萌妹纸的霸气范
5楼-- · 2019-01-01 12:42

I just updated Google Play services under the Extras folder in Android SDK Manager

查看更多
笑指拈花
6楼-- · 2019-01-01 12:44

I had the same issue. The issue was that the "google-play-services.jar" was not properly imported into my project even though it was part of the google_play_service_lib project. If you are using Eclipse, please check and see if you can see the play services jar file in the Android Private Libraries section and if this is exported by the library.

I am using Android SDK platform tools version 17 (not 19) and Android SDK tools version 22.0.1

查看更多
冷夜・残月
7楼-- · 2019-01-01 12:45

For everyone using Eclipse, this is how you should do it.

Eclipse -> import -> existing android code -> browse -> navigate to google-play-services_lib FOLDER (android-sdk/extras/google/google_play_services/libproject).

Then, on your project

control click -> properties -> android -> libraries, add -> select the project you just imported -> ok

查看更多
登录 后发表回答