Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: dotnet/java-interop
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0ad0d407
Choose a base ref
...
head repository: dotnet/java-interop
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 66312f7a
Choose a head ref
  • 2 commits
  • 5 files changed
  • 2 contributors

Commits on Oct 20, 2025

  1. Bump to dotnet/android-tools@8722663 (#1368)

    Bumps [external/xamarin-android-tools](https://github.com/xamarin/xamarin-android-tools) from `2609c38` to `8722663`.
    - [Commits](dotnet/android-tools@2609c38...8722663)
    
    ---
    updated-dependencies:
    - dependency-name: external/xamarin-android-tools
      dependency-version: 87226632ff5eaa27461a30bda4dda37642491415
      dependency-type: direct:production
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored and jonathanpeppers committed Oct 20, 2025
    Configuration menu
    Copy the full SHA
    0b7b3e9 View commit details
    Browse the repository at this point in the history
  2. [Java.Interop.Tools.JavaCallableWrappers] Improve missing attribute (#…

    …1369)
    
    Context: bc44f08
    
    If "something goes wrong" and the `*.jlo.xml` files contain
    `//jcw-types/type` elements that are *missing* the `//type/@package`
    attribute, then an exception is thrown:
    
    	System.InvalidOperationException: Missing required attribute 'package'
    	   at Java.Interop.Tools.JavaCallableWrappers.Extensions.XmlExtensions.GetRequiredAttribute(XElement xml, String name)
    	   at Java.Interop.Tools.JavaCallableWrappers.Adapters.XmlImporter.ImportType(XElement xml)
    	   at Java.Interop.Tools.JavaCallableWrappers.Adapters.XmlImporter.Import(XElement xml)
    	   at Xamarin.Android.Tasks.JavaObjectsXmlFile.Import(String filename, JavaObjectsXmlFileReadType readType)
    	   at Xamarin.Android.Tasks.GenerateJavaCallableWrappers.GenerateWrappers(List`1 assemblies)
    	   at Xamarin.Android.Tasks.GenerateJavaCallableWrappers.RunTask()
    	   at Microsoft.Android.Build.Tasks.AndroidTask.Execute()
    
    Which is all well and good, except ***I have no idea what's broken***.
    
    *Something* within dotnet/android should be updated so that the file
    causing the exception is mentioned, but we can also improve the
    `InvalidOperationException` to contain at least a "breadcrumb" for
    what's going wrong.
    
    Update the `InvalidOperationException` to also include the contents
    of the `XElement.ToString()` which is missing the required attribute.
    We can then at least search file contents to find the "offending" file.
    
    This provides a more useful exception message:
    
    	System.InvalidOperationException: Missing required attribute 'package' within element `<type name="SKCanvasElementImpl" package="" application_java_class="android.support.multidex.MultiDexApplication" mono_runtime_initialization="mono.MonoPackageManager.LoadApplication (context);" extends_type="Uno.WinUI.Graphics2DSK.SKCanvasElement" partial_assembly_qualified_name="SKCanvasElementImpl, SamplesApp">
    	  <constructors>
    	    <constructor name="SKCanvasElementImpl" method="n_.ctor:(Landroid/content/Context;)V:" jni_signature="(Landroid/content/Context;)V" managed_parameters="Android.Content.Context, Mono.Android" params="android.content.Context p0" retval="void" is_dynamically_registered="True" super_call="p0" activate_call="p0" />
    	  </constructors>
    	</type>`.
    	   at Java.Interop.Tools.JavaCallableWrappers.Extensions.XmlExtensions.GetRequiredAttribute(XElement xml, String name)
    	   at Java.Interop.Tools.JavaCallableWrappers.Adapters.XmlImporter.ImportType(XElement xml)
    	   at Java.Interop.Tools.JavaCallableWrappers.Adapters.XmlImporter.Import(XElement xml)
    	   at Xamarin.Android.Tasks.JavaObjectsXmlFile.Import(String filename, JavaObjectsXmlFileReadType readType)
    	   at Xamarin.Android.Tasks.GenerateJavaCallableWrappers.GenerateWrappers(List`1 assemblies)
    	   at Xamarin.Android.Tasks.GenerateJavaCallableWrappers.RunTask()
    	   at Microsoft.Android.Build.Tasks.AndroidTask.Execute()
    
    Which shows *two* problems:
    
     1. The `package` attribute *is* present, but
     2. The `package` attribute is the empty string.
    
    Which should be supported!  The global package is A Thing That Exists™;
    it should be supported!  (Has *been* supported?!)
    
    Update `XmlImporter.ImportType()` so that `package` is *not* required.
    
    Update `tests/Java.Interop.Tools.JavaCallableWrappers-Tests` to add
    an explicit test for a type in the Java global package.
    jonpryor authored and jonathanpeppers committed Oct 20, 2025
    Configuration menu
    Copy the full SHA
    66312f7 View commit details
    Browse the repository at this point in the history
Loading