Help! Can't build project after trying to use Google Play Services!

I have no idea what I did, all I did was try to use the Ad plugin from google for my android project. After putting it in my project and trying to build I get this error.

Error building Player: CommandInvokationFailure: Failed to re-package resources. See the Console for details.
C:\Users\Bryan\Desktop\adt-bundle-windows-x86_64-20131030\sdk\build-tools\android-4.4\aapt.exe package --auto-add-overlay -v -f -m -J gen -M AndroidManifest.xml -S "res" -I "C:/Users/Bryan/Desktop/adt-bundle-windows-x86_64-20131030/sdk/platforms/android-19\android.jar" -F bin/resources.ap_

stderr[
AndroidManifest.xml:9: error: Error: No resource found that matches the given name (at 'value' with value '@integer/google_play_services_version').
]
stdout[
Configurations:
 (default)

Files:
  drawable\app_icon.png
    Src: () res\drawable\app_icon.png
  values\strings.xml
    Src: () res\values\strings.xml
  AndroidManifest.xml
    Src: () AndroidManifest.xml

Resource Dirs:
  Type drawable
    drawable\app_icon.png
      Src: () res\drawable\app_icon.png
  Type values
    values\strings.xml
      Src: () res\values\strings.xml
Including resources from package: C:\Users\Bryan\Desktop\adt-bundle-windows-x86_64-20131030\sdk\platforms\android-19\android.jar
applyFileOverlay for drawable
applyFileOverlay for layout
applyFileOverlay for anim
applyFileOverlay for animator
applyFileOverlay for interpolator
applyFileOverlay for transition
applyFileOverlay for xml
applyFileOverlay for raw
applyFileOverlay for color
applyFileOverlay for menu
applyFileOverlay for mipmap
Processing image: res\drawable\app_icon.png
    (processed image res\drawable\app_icon.png: 94% size of source)
    (new resource id app_icon from drawable\app_icon.png #generated)
]

I really need help guys! Thanks!

Hi!

I had the same problem, after install Google Play Services from SDK Manager I followed the instruction of the question:
http://stackoverflow.com/questions/19843784/google-play-services-library-update-and-missing-symbol-integer-google-play-serv
Itā€™s not the best solution but works.

I would like to know a better way to fix this.

I found a better solution:
Copy google-play-services_lib folder to Plugins/Android, so you donā€™t have to hard code Google Play Serviceā€™s value.
https://github.com/googleads/googleads-mobile-plugins/issues/11

2 Likes

Thanks, that helped. I accidentally imported the root folder of google-play-services_lib into the project. Now the error is gone.

You do not have to add the entire folder!
you only need to add the version.xml file to your project: (the version.xml file contains the missing Integer value that the compiler complains about)

  1. get the version.xml file from you android-sdk path. for me, its located here:
    C:\Android\android-sdk\extras\google\google_play_services\libproject\google-play-services_lib\res\values\versions.xml

  2. place the version.xml file in your project:
    Assets\Plugins\Android\res\values\version.xml

4 Likes

Thanks that helped

Thanks Chip, that worked, it does give me a warning that itā€™s obsolete now, precisely:

ā€œOBSOLETE - Providing Android resources in Assets/Plugins/Android/res is deprecated, please move your resources to an Android Library. See ā€œBuilding Plugins for Androidā€ section of the Manual.
UnityEditor.HostView:OnGUI()ā€

But at least it can build for now :slight_smile:

1 Like

Thank you
you are right :slight_smile:

I had the same problem and I just did the following (In unity):
ā€œGoogle Play Games ā†’ Setup ā†’ Android Setupā€ process which solved this (by creating the setup file for the play services).
This solved the issue in my case.

1 Like

Thanks so much! Have been pulling my hair out trying to solve a string of strange build issues, this was the last piece of the puzzle.

So Iā€™m trying to follow through this, and in our Google Play Games folder, there is no Setup folder

Also, we are lacking libproject

Every tutorial we have found requires us to have this, and we canā€™t run our project now

I join to the problemā€¦ just installed the Android SDK and I keep missing a decent documentation that explain what version I should download. I downloaded the 5.0.1 (API 21) and in the build settings I set that as minimum requirement. When I compile, Unity complains that minimum requirement is 6.0 (API 23). Why? So I installed that too, plus all the extrasā€¦ a total of 48 GB!

After 12 hours of setup and failed compilations the result is:
Error: No resource found that matches the given name (at ā€˜valueā€™ with value ā€™ @Integer /google_play_services_versionā€™
And I canā€™t find any version.xml file in any folder of android sdk to copy here and thereā€¦

But the main question is why did I pay for android pro licence??? To have this wonderful experience?!
So now I will have probably to wait for some update that will fix this (hopefully) and introduce new bugsā€¦
Very tired of thisā€¦

At the end I found this:
https://groups.google.com/forum/#!category-topic/google-admob-ads-sdk/game-engines/djySAXCZ7HE
And following those steps I was able to compileā€¦ what a mess!

If nothing helps (like for me), the file you need "version.xml " lies in play-services-basement-11.0.2.aar (version can be different).
All you need is to copy play-services-basement-11.0.2.aar from ā€œANDROID_SDK/extras/google/m2repository/com/google/android/gms/play-services-basement/11.0.2/ā€
(if you donā€™t have this folder, install Google Play Services in Android SDK manager->SDK Tools)
to Assets/Plugins/Android folder.

P.S. Now I have this problem again, because I need to build with Gradle, and nothing mentioned above works. Has anybody managed to build with Gradle project with Google play services?

1 Like

Were you able to fix this? Iā€™m now having this same damn issue:

Actually, I just deleted string

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

from manifest

3 Likes

But after deleting this line, I canā€™t log in with google play services.

1 Like

GameAnalytics can trigger that error in AndroidManifest.xml