Can't use google play services on unity java plugin
Solution 1
To fix this error, you have to copy the version.xml
file from android-sdk/extras/google/google_play_services/libproject/google-play-services_lib/res/values/
into Assets/Plugins/Android/res/values/
your Unity project's folder.
Solution 2
Don't copy all project into your Plugins/Android.
Config file Manifest.xml to right information. Copy to Plugins/Android.
<meta-data android:name="com.google.android.gms.games.APP_ID" android:value="\ android app id " /> <meta-data android:name="com.google.android.gms.appstate.APP_ID" android:value="\ android app id " /> <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" /> <activity android:name="com.google.example.games.pluginsupport.SignInHelperActivity" />
Copy Google play services jar -> to Plugins/Android
Copy all res folder -> to Plugins/Android/res
Solution 3
An updated simple solution:
Today, i have same issue.
I noticed that, when i copy folder
from android-sdk/extras/google/google_play_services/libproject/
named google-play-services_lib
; there is already this folder in Assets/Plugins/Android
on unity.
And name of the copied folder is to be goole-play-services_lib 1
.
So i only deleted this folder, and it is working fine.
![Dima](https://i.stack.imgur.com/qIg5h.jpg?s=256&g=1)
Comments
-
Dima about 2 years
I have a plugin for Unity that is written in Java. In this plugin I need to get the new Google Advertisement ID to do it, I have to add to the Manifest file:
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
When I compile, Unity is throwing error:
Error building Player: CommandInvokationFailure: Failed to re-package resources. See the Console for details. /Applications/adt/sdk/build-tools/android-4.2.2/aapt package --auto-add-overlay -v -f -m - J gen -M AndroidManifest.xml -S "res" -I "/Applications/adt/sdk/platforms/android- 19/android.jar" -F bin/resources.ap_ stderr[ AndroidManifest.xml:21: error: Error: No resource found that matches the given name (at 'value' with value '@integer/google_play_services_version'). ]
I also tried to add the Google play services jar to the [lugins/Androif folder but that didn't help. What is the correct way to make it work?