Upgrade from 5.0.1 to 5.1.2f1, can't build in android now

I upgraded from 5.0.1 to 5.1.2f1, can’t build in android now. (Free Unity version)

when attempting to build in android I get the following:

IndexOutOfRangeException: Array index is out of range.
UnityEditor.Android.PostProcessAndroidPlayer.CheckPluginsBundleIdForConflicts (System.String stagingArea, UnityEditor.Android.AndroidLibraries androidLibraries)
UnityEditor.Android.PostProcessAndroidPlayer.PostProcessInternal (BuildTarget target, System.String stagingAreaData, System.String stagingArea, System.String playerPackage, System.String installPath, System.String companyName, System.String productName, BuildOptions options)
UnityEditor.Android.PostProcessAndroidPlayer.PostProcess (BuildTarget target, System.String stagingAreaData, System.String stagingArea, System.String playerPackage, System.String installPath, System.String companyName, System.String productName, BuildOptions options)
UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (BuildPostProcessArgs args)
UnityEditor.PostprocessBuildPlayer.Postprocess (BuildTarget target, System.String installPath, System.String companyName, System.String productName, Int32 width, Int32 height, System.String downloadWebplayerUrl, System.String manualDownloadWebplayerUrl, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:316)
UnityEditor.HostView:OnGUI()

I’ve searched the web and nothing.

I reloaded the 4 unitypackages I use, with their latest versions as of today:
PUN+ from the unity store
GooglePlayGamesPlugin-0.9.21.unitypackage
Heyzap.unitypackage
GoogleMobileAds.unitypackage

I deleted the library folder and had Unity rebuild EVERYTHING from scratch. Nothing.

This error references lines numbers in Unity’s code itself so it’s impossible for me to know exactly what it’s complaining about. I can only assume it has something do with something in the android plugin’s folder.

Android “other settings” people sometimes ask about on this board:
Rendering path: forward
automatic graphics api: false
graphics api: OpenGLES2
multithreaded rendering: false
static batching: true
dynamic batching: true
GPU Skinning: true
VR Supported: false
min api: 2.3.3
device filter: FAT
api compatibility level: .net 2.0 subset

I downgraded to unity 5.0.4 and got everything to build.

Best I can tell it’s a bug in the GooglePlayGamesPlugin-0.9.21.unitypackage package. I tried downgrading that package first but to no avail.

On a side note there are two improvements to Unity I would suggest:

  • That error message tells me nothing. It’s probably on a try/catch that’s there to catch all the errors that fall through other checks. It would be nice to have a more accurate error message as to what array/area of the code is breaking.

  • You all have had Apple’s login ability integrated into the UnityEngine.SocialPlatforms namespace for a very long time now. But in order to log into Google’s network I have to use a third party tool. Either the one on github mentioned above, or purchasing one off your store. Considering the popularity of Google it seems to be a huge oversight on Unity’s part to not integrate this functionality immediately.