playgameservices / play-games-plugin-for-unity

Google Play Games plugin for Unity
Other
3.45k stars 962 forks source link

Resolver fails to fetch "license" dependencies #2181

Open dgabrielasa opened 6 years ago

dgabrielasa commented 6 years ago

After some break i tried to continue my unity project, but resolver shown a"Resolution Failed" message related to fetching firebase aars. Updated Unity to latest and imported the recent unity package (0.9.5), but it only got worse, with more fetch errors.

All fails are seems to be realted "license" aars? Can you hint me what i could do to resolve these files?

Resolution failed

Failed to fetch the following dependencies: com.google.firebase:firebase-analytics-license:15.0.0@aar com.google.firebase:firebase-common-license:15.0.0@aar com.google.firebase:firebase-analytics-impl-license:15.0.0@aar com.google.android.gms:play-services-games-license:15.0.0@aar com.google.android.gms:play-services-nearby-license:15.0.0@aar com.google.firebase:firebase-iid-license:15.0.0@aar com.google.android.gms:play-services-drive-license:15.0.0@aar com.google.android.gms:play-services-auth-api-phone-license:15.0.0@aar com.google.android.gms:play-services-auth-base-license:15.0.0@aar

UnityEngine.Debug:LogError(Object) Google.Logger:Log(String, LogLevel) GooglePlayServices.PlayServicesResolver:Log(String, LogLevel) GooglePlayServices.ResolverVer1_1:LogMissingDependenciesError(List1) GooglePlayServices.<DoResolutionUnsafe>c__AnonStorey4:<>m__1(List1) GooglePlayServices.cAnonStorey0:<>m0(Result) GooglePlayServices.cAnonStorey1:<>m0() GooglePlayServices.PlayServicesResolver:PumpUpdateQueue() UnityEditor.EditorApplication:Internal_CallUpdateFunctions()

indiespace commented 6 years ago

I'm getting a similar issue also. I will try to investigate.

Resolution failed

Failed to fetch the following dependencies: com.google.android.gms:play-services-base-license:15.0.0 com.google.android.gms:play-services-tasks-license:15.0.0 com.google.firebase:firebase-analytics-impl-license:15.0.0 com.google.firebase:firebase-analytics-license:15.0.0 com.google.firebase:firebase-auth-license:15.0.0 com.google.firebase:firebase-common-license:15.0.0 com.google.firebase:firebase-config-license:15.0.0 com.google.firebase:firebase-iid-license:15.0.0

dgabrielasa commented 6 years ago

I would appreciate if you could share your findings here.

SrirachaSource commented 6 years ago

I was getting very similar issues with not being able to find version 15 of .aar and license files. According to these index sites, the files in question do not even exist. (https://dl.google.com/dl/android/maven2/com/google/firebase/group-index.xml and https://dl.google.com/dl/android/maven2/com/google/android/gms/group-index.xml)

The way I solved this was to create new unity project just for updating Firebase/play-services, it has nothing in it other than play services, google-ads, and Firebase plugins. Using this 'clean' project allows the Play-Services resolve step to complete successfully (oddly, nothing pulled down that was actually version 15.0.0, the highest version is 12.0.1 at this time). Back in my main project I then deleted the Firebase folder (except for the GoogleServices json/plist config files), I also delete GoogleMobileAds, GooglePlayGames, PlayServicesResolver, Parse, Plugins/Android/Firebase, and Plugins/Android/GoogleMobileAdsPlugin. I Then deleted all the .aar files related to play-services, firebase, and google-ads located in Plugins/Android. Finally, I copy over all of the similar data from my 'clean' project into my main project. Then, thankfully, I can build fine and the run-time works correctly too. Note: Make sure you disable 'Auto Resolution' in Assets->Player Services Resolver->Android Resolver->Settings

In conclusion, the resolver is dumb. Also I'm not sure why gradle keeps wanting to download version 15 (as of this writing) of everything for some projects. I suspect that gradle is running into problems with configuration keywords which cause it to bug-out and revert to some default version number. I've seen similar issues working gradle as mentioned here, just replace version 15.0.0 with 'EAP snapshot'. Also I have observed that when my Unity project is behaving this way it doesn't even matter what version of the firebase plugin I install, it always tries to download version 15 of everything file, further confirming that gradle is confused somehow. Unfortunately, all the inner workings are very opaque and it's hard to tell what the true source of the problem is.

dgabrielasa commented 6 years ago

Thanks for the detailed answer. I will try to do the same based on your guide, and share my experience here. I hoped i can avoid these type of hacks and there is a simplier / cleaner solution.

sweatyc commented 6 years ago

same here!

Resolution failed

Failed to fetch the following dependencies: com.google.firebase:firebase-core:15.0.1@aar com.google.firebase:firebase-analytics:15.0.1@aar com.google.firebase:firebase-analytics-impl:15.0.1@aar com.google.firebase:firebase-iid:15.0.1@aar com.google.firebase:firebase-analytics-license:15.0.1@aar com.google.firebase:firebase-common-license:15.0.1@aar com.google.firebase:firebase-analytics-impl-license:15.0.1@aar com.google.android.gms:play-services-tasks-license:15.0.1@aar com.google.firebase:firebase-iid-license:15.0.1@aar com.google.android.gms:play-services-base-license:15.0.1@aar

doing it in a fresh project with firebase only, no errors and it gets all 12.0.1 aars instead.... so something's wrong with 15.0.1 download links, etc.

sweatyc commented 6 years ago

That's my solution, may not be for others:

in PlayGameServicesDependencies.xml (and all other xmls if u use other play services), change all spec="xxxx:+" to spec="xxxx:12.0.1", e.g.:

<androidPackage spec="com.google.android.gms:play-services-plus:+">

to

<androidPackage spec="com.google.android.gms:play-services-plus:12.0.1">

Then PlayServicesResolver will get the 12.0.1 aars which are compatible for both playgames and firebase.

dgabrielasa commented 6 years ago

After several trys and failures i gave up to fix these issues by updating modules. My conclusion is: learn how to remove all modules, and reinstall + configure all conflicting modules every time when inconsistency appears. This is way faster than try to fix via updates, or hacking xmls, etc. Thoughts: since Unity and Google are clearly in some kind of partnership, it would be a good idea to

  1. create an online tool where you can assemble a package file which contains modules you need and versions are compatible with each other (play services, firebase, etc)
  2. make sure that resolver considering other modules and only updates when its safe regarding the rest of the modules.