I've removed old play-services-*-8.4.0.aars, restarted Unity. Manually invoked menu item Assets > Play Services Resolver > Android Resolver > Resolve Client Jars. No play-services-*-9.6.1.aars appeared.
KeyNotFoundException: The given key was not present in the dictionary.
System.Collections.Generic.Dictionary`2[System.String,System.Collections.Generic.HashSet`1[System.String]].get_Item (System.String key) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:150)
Google.JarResolver.PlayServicesSupport.ResolveDependencies (Boolean useLatest)
GooglePlayServices.ResolverVer1_1.DoResolutionNoAndroidPackageChecks (Google.JarResolver.PlayServicesSupport svcSupport, System.String destinationDirectory, Google.JarResolver.OverwriteConfirmation handleOverwriteConfirmation)
GooglePlayServices.ResolverVer1_1+<DoResolution>c__AnonStorey1.<>m__0 ()
GooglePlayServices.ResolverVer1_1.DoResolution (Google.JarResolver.PlayServicesSupport svcSupport, System.String destinationDirectory, Google.JarResolver.OverwriteConfirmation handleOverwriteConfirmation, System.Action resolutionComplete)
GooglePlayServices.PlayServicesResolver.Resolve (System.Action resolutionComplete)
GooglePlayServices.PlayServicesResolver.MenuResolve ()
Unity 5.3.6p6 on Windows 10 Pro targeting Android. Latest Android SDK installed with all components updated via Android SDK Manager.
@claywilkinson Any ideas on how to make Jar Resolver work?
I am not sure what you are asking? If you update to 0.9.35, it should alert you that you have upgraded to 0.9.35 successfully, then restart Unity to clear out the old resolver from memory, then run Assets/Play Services Resolver/Android Resolver/Resolve Client jars.
@claywilkinson Invoking “Resolve Client Jars” does not remove 8.4.0 versions, and outputs KeyNotFoundException to Console. I'm pretty sure, that raw obscure KeyNotFoundException should not be exposed to user anyway. Informative high-level exception should be preferred instead.
@claywilkinson Investigating with dotPeek shows that problem is probably in PlayServicesSupport.ResolveDependencies() in the line
this.Log("WARNING: No compatible versions of " + dependency2.VersionlessKey + " required by (" + string.Join(", ", new List<string>((IEnumerable<string>) dictionary3[dependency2.VersionlessKey]).ToArray()) + "), will try using the latest version " + dependency2.BestVersion, false);
dictionary3 seems to not contain requested key (probably typo).
Please help me get Play Services updated; I cannot move on with my tasks, and release is coming :(
Hi im having the same problem there is no way for me to get it working. I imported the latest version and keep getting this log.
WARNING: No compatible versions of com.android.support:support-v4 required by (com.android.support:appcompat-v7:23.1.0+, com.google.android.gms:play-services-basement:9.6.0), will try using the latest version 24.0.0
WARNING: No compatible versions of com.android.support:support-annotations required by (com.android.support:support-v4:23.1+, com.android.support:support-v4:24.0.0), will try using the latest version 24.0.0
What should i do ? I have tried the version before the last one and i get errors with the Logger class everywhere, my realease is close too i need to get this working.
Looks like there are two issues here:
@Qbit86 - the KeyNotFoundException is resolved by closing Unity, then deleting the file ProjectSettings/GoogleDependencyGooglePlayGames.xml and then open Unity and the resolver should work.
@jeffnatibes - These are warnings and are OK - it is pointing out some inconsistencies in the metadata of the various libraries. Using the latest version is the correct thing to do.
@claywilkinson
_the KeyNotFoundException is resolved by closing Unity..._
This does not help.
Anyway, performing some magic moves is not solution. Well, KeyNotFoundException — which key exactly? Why you access item by key in dictionary with [] instead of exception-safe check via TryGetValue()? Looks like there are some assumptions not satisfied, some logic is broken. This is callee-side issue, not caller-side. NullReferenceException and KeyNotFoundException should not propagate to user, neither they should be caught — they should be checked in runtime and handled.
@claywilkinson Could you please check the line from decompiled assembly I mentioned above?
The source is at https://github.com/googlesamples/unity-jar-resolver
The hashset is created by reading an xml file containing all the dependencies that need to be resolved. Can you share the contents of ProjectSettings/GoogleDependencyGooglePlayGames.xml?
GoogleDependencyGooglePlayGames.xml:
<dependencies><dependency><groupId>com.google.android.gms</groupId><artifactId>play-services-games</artifactId><version>9+</version><packageIds>extra-google-m2repository</packageIds></dependency><dependency><groupId>com.google.android.gms</groupId><artifactId>play-services-nearby</artifactId><version>9+</version><packageIds>extra-google-m2repository</packageIds></dependency><dependency><groupId>com.google.android.gms</groupId><artifactId>play-services-auth</artifactId><version>9+</version><packageIds>extra-google-m2repository</packageIds></dependency><dependency><groupId>com.android.support</groupId><artifactId>support-v4</artifactId><version>23.1+</version><packageIds>extra-android-m2repository</packageIds></dependency></dependencies>
GoogleDependencyGoogleCloudMessagingPlugin.xml:
<dependencies><dependency><groupId>com.google.android.gms</groupId><artifactId>play-services-gcm</artifactId><version>8.4+</version></dependency></dependencies>
GoogleDependencyGoogle.GPGS.xml:
<dependencies><dependency><groupId>com.google.android.gms</groupId><artifactId>play-services-games</artifactId><version>8.1+</version></dependency><dependency><groupId>com.google.android.gms</groupId><artifactId>play-services-nearby</artifactId><version>8.1+</version></dependency><dependency><groupId>com.google.android.gms</groupId><artifactId>play-services-plus</artifactId><version>8.1+</version></dependency><dependency><groupId>com.android.support</groupId><artifactId>appcompat-v7</artifactId><version>23.1.0+</version></dependency><dependency><groupId>com.google.android.gms</groupId><artifactId>play-services-ads</artifactId><version>8.1+</version></dependency></dependencies>
_The source is at https://github.com/googlesamples/unity-jar-resolver_
https://github.com/googlesamples/unity-jar-resolver/blob/master/source/JarResolverLib/src/Google.JarResolver/PlayServicesSupport.cs:
Log("WARNING: No compatible versions of " +
currentDep.VersionlessKey + " required by (" +
String.Join(
", ", (new List<string>(
reverseDependencyTree[
currentDep.VersionlessKey])).ToArray()) +
"), will try using the latest version " +
currentDep.BestVersion);
_The hashset is created by reading an xml file containing all the dependencies that need to be resolved._
It's not HashSet that probably causes the problem; it's Dictionary, probably this call: reverseDependencyTree[currentDep.VersionlessKey].
First off, thanks for the details - I'll take a look.
It looks like the problem is with the other xml files, GoogleDependencyGooglePlayGames.xml looks OK - I can see the packageIds element, the other two files do not have this element, so they are old. Can you delete those too?
Do you know which plugins those files are coming from? you might need to tweak where they call DependOn to match what the new version should have.
For example change:
svcSupport.DependOn("com.google.android.gms",
"play-services-plus",
"8.4+")
to be (as seen in GPGSDependencies.cs):
Google.VersionHandler.InvokeInstanceMethod(
svcSupport, "DependOn",
new object[] { "com.google.android.gms", "play-services-games",
PluginVersion.PlayServicesVersionConstraint },
namedArgs: new Dictionary<string, object>() {
{"packageIds", new string[] { "extra-google-m2repository" } }
});
I am not sure if this is related but I just performed the following steps:

The previous version of 'play-games-plugin-for-unity' was working absolutely fine; for some reason the latest update is broken for me.
Any suggestions?
@kruncher - There is some code in the resolver that unpacks the aar using jar in some cases. It looks like you need to set JAVA_HOME to the Java SDK (not JRE) and restart Unity.
@claywilkinson Thanks for your fast response, this seems to have resolved that issue.
I am now seeing the following messages in the console window:

I am not sure what the <RI.Hid> Failed to create device file: message is; I believe that this is probably just an issue with Unity itself; but the other 4 warnings are being output by 'play-games-plugin-for-unity'.
The warnings are OK - they are just pointing out inconsistencies in the metadata, and using the latest version is the correct thing to do.
The
Cheers :)
@claywilkinson
Can you delete those too?
Thanks, I will try this tomorrow.
It looks like the problem is with the other xml files
Even if they are completely malformed (like containing mp3 instead of xml), the library should inform with some specific exception or error message, so the user can figure out what is wrong and how to fix it.
Do you know which plugins those files are coming from?
One is from Prime31 plugin for Google Cloud Messaging. (I have let them know that new version of Jar Resolver is available so they can update their plugins.) Don't remember about another, will try to investigate git history tomorrow.
@kruncher
for some reason the latest update is broken for me.
Also make sure to update Android SDK via SDK Manager, so it can download latest play-services-*.aars, so Jar Resolver can find them.
@Qbit86 - totally agree the exception is not acceptable, we're working on a fix. Thanks again.
@claywilkinson Hi thank you for the tip. I still have problems making it work thoe, my app is published as alpha test apk with alpha testers enabled and Google Play Services Testers added aswell. Still cant get the test user to authenticate it always fails. I have debuged through the logcat and i get the following debug message :
DEBUG: Starting Auth Transition. Op: SIGN_IN status: ERROR_NOT_AUTHORIZED
Here is part of the full log : http://pastebin.com/hEfwbnkF
What could be causing this ?
P.D: The SHA1 is correctly configured in Google Play Console, Google API Console and the APK is signing with the correct SHA1 from the KeyStore.
Do you know which plugins those files are coming from?
One is from Prime31 plugin for Google Cloud Messaging.
The other — ProjectSettings/GoogleDependencyGoogle.GPGS.xml — seems to be installed long ago with old version of Google Play Games plugin, like 0.9.27 or so.
Can you delete those too?
I've deleted those ProjectSettings/GoogleDependency*.xml files, and Jar Resolver has finished with no errors. But two aars are still 8.4.0: play-services-ads-8.4.0.aar, play-services-gcm-8.4.0.aar.
you might need to tweak where they call DependOn to match what the new version should have.
Currently there are no calls to DependOn (apart from GPGSDependencies.cs).
@claywilkinson Is it safe to add ProjectSettings\GoogleAarExplodeCache.xml to git ignore-list? I guess it should not be versioned, should it?
For those wondering. I ran into this issue recently (today) and was able to solve it by following a mix of steps above and others.
@qbit86 - yes, it is safe to add GoogleAarExplodeCache to git ignore. The latest version of the plugin 0.9.36, uses an updated jar resolver that improves this experience.