-
Notifications
You must be signed in to change notification settings - Fork 359
NullReferenceException with 1.2.19.0 #48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thanks for the feedback. We'll look into it. To clarify, the aars are resolved OK, it just prints this exception in the console? |
@claywilkinson , |
On OSX 10.12.4 with Unity 5.6.0f3, I just:
All dependencies are pulled into the project and no errors are reported. Could you share a project that reproduces the issue? Also, it would be great to share the Unity log with verbose logging enabled in the Jar Resolver so that we can figure out what's going on here. |
Hi @stewartmiles , The issue is caused by support-v4:
Specifically, by "-alpha1" in the version (support-v4-26.0.0-alpha1). It happens when the appropriate library has been already added (this is why the first resolution works fine) when checking if the library has to be updated or not.
is called with two arguments:
to return null. I'm currently working on a fix, not sure yet how difficult it will be for me and how much time will take. P.S. There is one more related issue: Unity Console contains warnings:
Regards, |
Please review pull request #49. |
Ah sorry @yuriy-universal-ivanov I missed your last issue update here. I reviewed your pull request without that context. It makes sense now. This code base does a pretty terrible job attempting to support -alpha versions strings etc. TBH we would really like to purge the maven dependency management code from this code base entirely and just use gradle to download dependencies, we have a start but there is a load of remaining work to do. I think the problem is in the caching code in Resolver1_1.cs rather than JarResolverLib. I've pushed a potential fix for the problem. |
I was unable to reproduce #48 however from the stack trace it looks like the cached target dependency isn't found by GooglePlayServices.ResolverVer1_1.ShouldReplaceDependency(). This is very likely to be caused by the AAR cache referencing a file that has since been deleted. In the case the target file isn't found we simply permit the replacement of the dependency. Change-Id: I595e395a750362b38ed7a1a6f638a5751b45a87a
Hi @stewartmiles , Thanks for checking that. Well, I understand that my fix makes Play Services Resolver consider versions x.y.z-alpha & x.y.z the same, but as they were stored without that -alpha like postfixes in Plugins/Android, I thought it was done by design. Actually, as I can see from your commit:
you didn't change that trouble anyway. Of course your change will suppress throwing the exception, but I don't think it's a very good idea to get round the issue this way. What I did in #49 is basically I applied the same rule (and the same function) for extracting version code as used to generate file names when storing them in Plugins/Android folder, so repetitive checks for versions with -alpha like postfixes don't misdetect them as a new version each time). What your code does - is first looking for the file in FindAarInTargetPath by a wrong name (as it was stored without -alpha, but it looks for a file name with -alpha postfix). It can't locate the file of course, so it just skips. But what if I delete the stored .aar file? It will still be unable to locate the file and will just ignore that, because of your I believe my approach is much more correct. Besides, I've tested it, and it seems to work completely well. Even those warnings I've mentioned above gone (though I'm not sure that it's indeed my change caused that, maybe they are just shown only once). I hope I explained it clear enough. Please correct me wherever I'm wrong. Regards, |
Using the same rule (and the same function) for extracting a version code when comparing libraries versions, as used to generate file names when storing them in Plugins/Android folder, so repetitive checks for versions with -alpha like postfixes don't misdetect them as a new version each time.
Thanks for the explanation @yuriy-universal-ivanov your patch sounds good. Just need the commit message updated to describe what's going on in the patch so that other folks don't come across the change and ask the same questions I have asked. |
For more information see: #48 Change-Id: I2181106e9b2cb87a98aa16a675ae095a0627c930
Hi,
Due to #47 I had to update Play Services Resolver. Now it works, but all the time logs the exception in Unity Console:
NullReferenceException: Object reference not set to an instance of an object
GooglePlayServices.ResolverVer1_1.AarPathToPackageName (System.String aarPath)
GooglePlayServices.ResolverVer1_1.FindAarExplodeDataEntry (System.String aarPath)
GooglePlayServices.ResolverVer1_1.ShouldExplode (System.String aarPath)
GooglePlayServices.ResolverVer1_1.ShouldReplaceDependency (Google.JarResolver.Dependency oldDependency, Google.JarResolver.Dependency newDependency)
GooglePlayServices.PlayServicesResolver.m__C (Google.JarResolver.Dependency oldDependency, Google.JarResolver.Dependency newDependency)
Google.JarResolver.PlayServicesSupport.CopyDependencies (System.Collections.Generic.Dictionary`2 dependencies, System.String destDirectory, Google.JarResolver.OverwriteConfirmation confirmer)
GooglePlayServices.ResolverVer1_1.DoResolutionNoAndroidPackageChecks (Google.JarResolver.PlayServicesSupport svcSupport, System.String destinationDirectory, Google.JarResolver.OverwriteConfirmation handleOverwriteConfirmation)
GooglePlayServices.ResolverVer1_1+c__AnonStorey8.<>m__10 ()
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.AutoResolve ()
UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at /Users/builduser/buildslave/unity/build/artifacts/generated/common/editor/EditorApplicationBindings.gen.cs:249)
Resolver 1.2.19.0, Unity 5.6, macOS.
Thank you for any help with it,
Yuriy
The text was updated successfully, but these errors were encountered: