-
Notifications
You must be signed in to change notification settings - Fork 57
[Java.Interop.Tools.JavaCallableWrappers] make TypeNameMapGenerator d… #91
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
[Java.Interop.Tools.JavaCallableWrappers] make TypeNameMapGenerator d… #91
Conversation
Hi @radekdoulik, I'm your friendly neighborhood .NET Foundation Pull Request Bot (You can call me DNFBOT). Thanks for your contribution! TTYL, DNFBOT; |
@radekdoulik, Thanks for signing the contribution license agreement so quickly! Actual humans will now validate the agreement and then evaluate the PR. |
@radekdoulik: Do you have the stack trace that you're trying to fix here? |
…isposable - we need that, because the resolver is referenced inside cecil objects and so if we dispose the resolver in the constructor [0], the disposed resolver is later used thru Write methods [1] and it fails because its cache is already disposed [0] the location of the disposal at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Dispose (System.Boolean disposing) [0x00000] in <3f2ebd7ea1fd47bd954f448c66f03323>:0 at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Dispose () [0x00000] in <3f2ebd7ea1fd47bd954f448c66f03323>:0 at Java.Interop.Tools.JavaCallableWrappers.TypeNameMapGenerator..ctor (System.Collections.Generic.IEnumerable`1[T] assemblies, System.Action`2[T1,T2] logMessage) [0x00000] in <3076bd81225243d6b1a7e6e2e66cb5f7>:0 at Xamarin.Android.Tasks.GenerateJavaStubs.WriteTypeMappings (System.Collections.Generic.List`1[T] types) [0x00000] in <d1b286cda0c74ed8bdaf1b21993bd410>:0 at Xamarin.Android.Tasks.GenerateJavaStubs.Run (Java.Interop.Tools.Cecil.DirectoryAssemblyResolver res) [0x00000] in <d1b286cda0c74ed8bdaf1b21993bd410>:0 at Xamarin.Android.Tasks.GenerateJavaStubs.Execute () [0x00000] in <d1b286cda0c74ed8bdaf1b21993bd410>:0 ... [1] exception when using the disposed resolver (because cache is cleared and thus null) Error executing task GenerateJavaStubs: System.NullReferenceException: Object reference not set to an instance of an object at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve (Mono.Cecil.AssemblyNameReference reference, Mono.Cecil.ReaderParameters parameters) [0x00028] in <3f2ebd7ea1fd47bd954f448c66f03323>:0 at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve (Mono.Cecil.AssemblyNameReference reference) [0x00001] in <3f2ebd7ea1fd47bd954f448c66f03323>:0 at Mono.Cecil.MetadataResolver.Resolve (Mono.Cecil.TypeReference type) [0x0004e] in <4f9b8c8361824d0ca9025449919e12be>:0 at Mono.Cecil.ModuleDefinition.Resolve (Mono.Cecil.TypeReference type) [0x00007] in <4f9b8c8361824d0ca9025449919e12be>:0 at Mono.Cecil.TypeReference.Resolve () [0x00014] in <4f9b8c8361824d0ca9025449919e12be>:0 at Java.Interop.Tools.Cecil.TypeDefinitionRocks.GetBaseType (Mono.Cecil.TypeDefinition type) [0x00014] in <3f2ebd7ea1fd47bd954f448c66f03323>:0 at Java.Interop.Tools.Cecil.TypeDefinitionRocks+<GetTypeAndBaseTypes>c__Iterator0.MoveNext () [0x00048] in <3f2ebd7ea1fd47bd954f448c66f03323>:0 at System.Linq.Enumerable.Any[TSource] (System.Collections.Generic.IEnumerable`1[T] source, System.Func`2[T,TResult] predicate) [0x00048] in <51a1d86c1edf494cacaba8bbf8d1334e>:0 at Java.Interop.Tools.Cecil.TypeDefinitionRocks.ImplementsInterface (Mono.Cecil.TypeDefinition type, System.String interfaceName) [0x00014] in <3f2ebd7ea1fd47bd954f448c66f03323>:0 at Java.Interop.Tools.TypeNameMappings.JniType.ToJniName (Mono.Cecil.TypeDefinition type, Java.Interop.ExportParameterKind exportKind) [0x00049] in <3076bd81225243d6b1a7e6e2e66cb5f7>:0 at Java.Interop.Tools.TypeNameMappings.JniType.ToJniName (Mono.Cecil.TypeDefinition type) [0x00001] in <3076bd81225243d6b1a7e6e2e66cb5f7>:0 at Java.Interop.Tools.JavaCallableWrappers.TypeNameMapGenerator.GetTypeMapping (System.Func`2[T,TResult] skipType, System.Func`2[T,TResult] key, System.Func`2[T,TResult] value) [0x00047] in <3076bd81225243d6b1a7e6e2e66cb5f7>:0 at Java.Interop.Tools.JavaCallableWrappers.TypeNameMapGenerator.WriteJavaToManaged (System.IO.Stream output) [0x00012] in <3076bd81225243d6b1a7e6e2e66cb5f7>:0 at Xamarin.Android.Tasks.GenerateJavaStubs.UpdateWhenChanged (System.String path, System.Action`1[T] generator) [0x00014] in <d1b286cda0c74ed8bdaf1b21993bd410>:0 at Xamarin.Android.Tasks.GenerateJavaStubs.WriteTypeMappings (System.Collections.Generic.List`1[T] types) [0x00078] in <d1b286cda0c74ed8bdaf1b21993bd410>:0 at Xamarin.Android.Tasks.GenerateJavaStubs.Run (Java.Interop.Tools.Cecil.DirectoryAssemblyResolver res) [0x00153] in <d1b286cda0c74ed8bdaf1b21993bd410>:0 at Xamarin.Android.Tasks.GenerateJavaStubs.Execute () [0x001f2] in <d1b286cda0c74ed8bdaf1b21993bd410>:0 ...
815eb51
to
24c6820
Compare
yup. I have updated the commit message. see radekdoulik@24c6820 |
Changes: dotnet/android-tools@3974fc3...f2af06f * dotnet/android-tools@f2af06f: [Xamarin.Android.Tools.AndroidSdk] Fix a few nullability warnings (#97) * dotnet/android-tools@5718cd2: Fix sort ordering for ndk-bundle, add macOS support (#91) * dotnet/android-tools@8e63795: [Xamarin.Android.Tools.AndroidSdk] Add API-29, API-30 to KnownVersions (#89) * dotnet/android-tools@a6a23bb: [Xamarin.Android.Tools.AndroidSdk] Default SDK component versions (#93) * dotnet/android-tools@32a1e2c: [build] fail macOS build if tests fail (#94) * dotnet/android-tools@79a0141: Return a default for unknown API levels (#90)
…isposable
objects and so if we dispose the resolver in the constructor, the
disposed resolver is later used thru Write methods and it fails
because its cache is already disposed