-
Notifications
You must be signed in to change notification settings - Fork 0
Comparing changes
Open a pull request
base repository: jtschuster/java-interop
base: main
head repository: dotnet/java-interop
compare: main
- 18 commits
- 16 files changed
- 5 contributors
Commits on Sep 19, 2025
-
[Java.Interop.Tools.Generator] Improve ExtractApiLevel() resiliency (d…
…otnet#1365) Context: f07b538 Context: https://github.com/jpobst/BindingStudio While using jpobst/BindingStudio to enumify API-36.1, it would crash: System.NotSupportedException: Could not parse `W` as an ApiLevel. at Java.Interop.Tools.Generator.AndroidSdkVersion.Parse(String value) in W:\src\jpobst\BindingStudio\external\Java.Interop\src\Java.Interop.Tools.Generator\Utilities\AndroidSdkVersion.cs:line 124 at Java.Interop.Tools.Generator.NamingConverter.ParseApiLevel(String value) in W:\src\jpobst\BindingStudio\external\Java.Interop\src\Java.Interop.Tools.Generator\Utilities\NamingConverter.cs:line 21 at Java.Interop.Tools.Generator.NamingConverter.ParseApiLevel(XElement element) in W:\src\jpobst\BindingStudio\external\Java.Interop\src\Java.Interop.Tools.Generator\Utilities\NamingConverter.cs:line 60 at Java.Interop.Tools.Generator.Enumification.MethodMapEntry.FromElement(XElement element, String parameterName) in W:\src\jpobst\BindingStudio\external\Java.Interop\src\Java.Interop.Tools.Generator\Enumification\MethodMapEntry.cs:line 41 at Java.Interop.Tools.Generator.Enumification.MethodMapEntry.FromElement(XElement element, String parameterName) in W:\src\jpobst\BindingStudio\external\Java.Interop\src\Java.Interop.Tools.Generator\Enumification\MethodMapEntry.cs:line 54 at Java.Interop.Tools.Generator.Enumification.MethodMapEntry.FromXml(XElement element)+MoveNext() in W:\src\jpobst\BindingStudio\external\Java.Interop\src\Java.Interop.Tools.Generator\Enumification\MethodMapEntry.cs:line 31 The cause of the crash is that the `api-36.1.xml` file it was processing had `//@merge.SourceFile` attributes with the value: merge.SourceFile="…Xamarin-Work/src/dotnet/android/build-tools/create-android-api/../../bin/BuildDebug/api/api-36.1.xml.in" Notice the `-Work` in the value. This was used by `ExtractApiLevel()` to try to find numbers after the `-`, but `W` was after the `-`, not numbers. This didn't previously matter because f07b538 noted: > *Note*: Changes to `NamingConverter.ParseApiLevel()` are largely a > nothing-burger because the dotnet/android side usually has metadata: > > <attr > api-since="36.1" > path="/api//*[contains(@merge.SourceFile,'api-CANARY.xml.in')]" > name="api-since">36.1</attr > > which explicitly adds/sets `//@api-since` based on the > `//@merge.SourceFile` value. However, when jpobst/BindingStudio is used, `src/Mono.Android/metadata` is *not* used, and `//@merge.SourceFile` is instead used. Improve `ParseApiLevel()` to check for an `api-` prefix before looking for trailing numeric data.
Configuration menu - View commit details
-
Copy full SHA for 19be370 - Browse repository at this point
Copy the full SHA 19be370View commit details
Commits on Sep 23, 2025
-
[generator]
FixupMethodOverrides()checks properties (dotnet#1366)Context: dotnet#1313 Fixes: dotnet/android#10509 In .NET 10 RC 1, `View.Foreground` is defined in C# as: [SupportedOSPlatform("android23.0")] public virtual Drawable? Foreground { get; set; } But `FrameLayout.Foreground` is defined as: [UnsupportedOSPlatform("android23.0")] public override Drawable? Foreground { get; set; } I think this is the exact same bug that was addressed in dotnet#1313 for methods, but we still have the issue for properties. I was able to duplicate the test and make a `getThing()` and `setThing()` methods in Java to see the issue. I updated the `FixupMethodOverrides()` to iterate over properties and do the same fixup for property getters and setters. This also needed to be done for: * Interfaces * Fields (think of `static final int` values)
Configuration menu - View commit details
-
Copy full SHA for ef82a07 - Browse repository at this point
Copy the full SHA ef82a07View commit details
Commits on Oct 16, 2025
-
Bump to dotnet/android-tools@8722663 (dotnet#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>
Configuration menu - View commit details
-
Copy full SHA for e33beb3 - Browse repository at this point
Copy the full SHA e33beb3View commit details
Commits on Oct 20, 2025
-
[Java.Interop.Tools.JavaCallableWrappers] Improve missing attribute (d…
…otnet#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.
Configuration menu - View commit details
-
Copy full SHA for 34113b9 - Browse repository at this point
Copy the full SHA 34113b9View commit details
Commits on Oct 21, 2025
-
Bump to dotnet/android-tools@c8b05f6 (dotnet#1370)
Bumps [external/xamarin-android-tools](https://github.com/xamarin/xamarin-android-tools) from `8722663` to `c8b05f6`. - [Commits](dotnet/android-tools@8722663...c8b05f6) --- updated-dependencies: - dependency-name: external/xamarin-android-tools dependency-version: c8b05f6dce08076758f28825ed261b92cf51b491 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Configuration menu - View commit details
-
Copy full SHA for 2c7b4e6 - Browse repository at this point
Copy the full SHA 2c7b4e6View commit details
Commits on Oct 23, 2025
-
Bump to dotnet/android-tools@ca74eba (dotnet#1371)
Bumps [external/xamarin-android-tools](https://github.com/xamarin/xamarin-android-tools) from `c8b05f6` to `ca74eba`. - [Commits](dotnet/android-tools@c8b05f6...ca74eba) --- updated-dependencies: - dependency-name: external/xamarin-android-tools dependency-version: ca74eba74c729bbd203008c32040eee6e4d017e4 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Configuration menu - View commit details
-
Copy full SHA for 33c259b - Browse repository at this point
Copy the full SHA 33c259bView commit details
Commits on Oct 29, 2025
-
[Java.Interop] Improve RegisterNativeMembers() error reporting (dotne…
…t#1372) Context: 356485e Somehow my .NET 10 RC2 installation became corrupted [^0]. One of the results of that corruption is that some dotnet/android apps, when built with NativeAOT, would "hang" at startup with this error message appearing on `adb logcat`: E AndroidRuntime: FATAL EXCEPTION: main E AndroidRuntime: Process: uno.platform.chefs.skia, PID: 7956 E AndroidRuntime: net.dot.jni.internal.JavaProxyThrowable: System.ArgumentException: Arg_DlgtTargMeth E AndroidRuntime: at Internal.Reflection.Augments.ReflectionAugments.CreateDelegate(Type, Type, String, Boolean, Boolean) + 0x266 E AndroidRuntime: at Microsoft.Android.Runtime.ManagedTypeManager.RegisterNativeMembers(JniType, Type, ReadOnlySpan`1) + 0x1d8 E AndroidRuntime: at Java.Interop.ManagedPeer.RegisterNativeMembers(IntPtr jnienv, IntPtr klass, IntPtr n_nativeClass, IntPtr n_methods) + 0x195 E AndroidRuntime: at net.dot.jni.ManagedPeer.registerNativeMembers(Native Method) E AndroidRuntime: at net.dot.android.ApplicationRegistration.registerApplications(ApplicationRegistration.java:11) E AndroidRuntime: at net.dot.jni.nativeaot.NativeAotRuntimeProvider.attachInfo(NativeAotRuntimeProvider.java:40) E AndroidRuntime: at android.app.ActivityThread.installProvider(ActivityThread.java:6391) E AndroidRuntime: at android.app.ActivityThread.installContentProviders(ActivityThread.java:5938) E AndroidRuntime: at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5853) E AndroidRuntime: at android.app.ActivityThread.access$1100(ActivityThread.java:199) E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1650) E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:106) E AndroidRuntime: at android.os.Looper.loop(Looper.java:193) E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:6669) E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method) E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858) Which raises the obvious question: what type was this happening with? It's good to know that `Delegate.CreateDelegate()` was throwing, but *why* was it throwing? Which type was involved? Update `ManagedPeer.cs` to use `JniEnvironment.BeginMarshalMethod()` et al (356485e) and remove use of `catch (…) when (…)`. Update `ManagedPeer.RegisterNativeMembers()` to catch exceptions thrown from `TypeManager.RegisterNativeMembers()` and wrap them into a `NotSupportedException` which provides the type that is involved. This results in a marginally more useful message in `adb logcat`: E AndroidRuntime: Process: uno.platform.chefs.skia, PID: 10761 E AndroidRuntime: net.dot.jni.internal.JavaProxyThrowable: System.NotSupportedException: Unable to register native members for Java type `crc64d0916be76e7aa092/NativeApplication` <=> managed type `Microsoft.UI.Xaml.NativeApplication, Uno.UI.Runtime.Skia.Android, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null`. E AndroidRuntime: ---> System.ArgumentException: Arg_DlgtTargMeth E AndroidRuntime: at Internal.Reflection.Augments.ReflectionAugments.CreateDelegate(Type, Type, String, Boolean, Boolean) + 0x266 E AndroidRuntime: at Microsoft.Android.Runtime.ManagedTypeManager.RegisterNativeMembers(JniType, Type, ReadOnlySpan`1) + 0x1d8 E AndroidRuntime: at Java.Interop.ManagedPeer.RegisterNativeMembers(IntPtr jnienv, IntPtr klass, IntPtr n_nativeClass, IntPtr n_methods) + 0x190 E AndroidRuntime: Exception_EndOfInnerExceptionStack E AndroidRuntime: at Java.Interop.ManagedPeer.RegisterNativeMembers(IntPtr jnienv, IntPtr klass, IntPtr n_nativeClass, IntPtr n_methods) + 0x403 E AndroidRuntime: at net.dot.jni.ManagedPeer.registerNativeMembers(Native Method) E AndroidRuntime: at net.dot.android.ApplicationRegistration.registerApplications(ApplicationRegistration.java:11) E AndroidRuntime: at net.dot.jni.nativeaot.NativeAotRuntimeProvider.attachInfo(NativeAotRuntimeProvider.java:40) E AndroidRuntime: at android.app.ActivityThread.installProvider(ActivityThread.java:6391) E AndroidRuntime: at android.app.ActivityThread.installContentProviders(ActivityThread.java:5938) E AndroidRuntime: at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5853) E AndroidRuntime: at android.app.ActivityThread.access$1100(ActivityThread.java:199) E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1650) E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:106) E AndroidRuntime: at android.os.Looper.loop(Looper.java:193) E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:6669) E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method) E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858) I still won't know *why* it's failing, but at least I have a breadcrumb to look into. [^0]: The fix was to nuke and recreate my .NET 10 RC2 install.
Configuration menu - View commit details
-
Copy full SHA for 749c65d - Browse repository at this point
Copy the full SHA 749c65dView commit details
Commits on Nov 5, 2025
-
[build] Change
$(JavacClasspathSeparator)to$(JavaPathSeparator)(……dotnet#1373) In `build-tools/Java.Interop.Sdk/Sdk/Sdk.props`, the property `$(JavaPathSeparator)` is defined, but the condition for the non-Windows case references an undeclared property `$(JavacClasspathSeparator)`. It causes on Windows, javac -classpath with multiple jars fails. This is likely a typo. This change corrects it to `$(JavaPathSeparator)` to match the property being defined.
Configuration menu - View commit details
-
Copy full SHA for faee0da - Browse repository at this point
Copy the full SHA faee0daView commit details
Commits on Jan 22, 2026
-
Bump to dotnet/android-tools@fb95edd (dotnet#1375)
Bumps [external/xamarin-android-tools](https://github.com/xamarin/xamarin-android-tools) from `ca74eba` to `fb95edd`. - [Commits](dotnet/android-tools@ca74eba...fb95edd) --- updated-dependencies: - dependency-name: external/xamarin-android-tools dependency-version: fb95edd359e6a6af9aecc4c82520f5a5f2ede824 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Configuration menu - View commit details
-
Copy full SHA for 9fe493a - Browse repository at this point
Copy the full SHA 9fe493aView commit details
Commits on Jan 26, 2026
-
[build] target
$(TargetFramework)=net10.0(dotnet#1377)This repo usually targets the latest stable release (or N-1). Previously, it was targeting `net9.0` for the .NET 10 release cycle.
Configuration menu - View commit details
-
Copy full SHA for c3c655a - Browse repository at this point
Copy the full SHA c3c655aView commit details -
[Java.Interop.Tools.JavaCallableWrappers] Auto-generate package name…
… empty (dotnet#1376) Context: dotnet/android#10653 When a user uses `[Register("CustomView")]` without a package prefix, the XmlImporter now auto-generates a crc64 package name from the partial assembly qualified name. This restores the previous .NET 9 behavior where Java types with empty package names could still be built. * Use existing JavaNativeTypeManager.GetPackageName instead of duplicating crc64 logic Added new `GetPackageName(string ns, string assemblyName)` overload to `JavaNativeTypeManager` and refactored existing overloads to use it. `XmlImporter` now uses this new method instead of duplicating the logic. * Add SetUp and TearDown to XmlImporterTests to save/restore PackageNamingPolicy Following the pattern used in `JavaNativeTypeManagerTests`, save and restore the `PackageNamingPolicy` to prevent test interference if other tests modify this static property. Co-authored-by: Jonathan Peppers <jonathan.peppers@microsoft.com>
Configuration menu - View commit details
-
Copy full SHA for b7965d4 - Browse repository at this point
Copy the full SHA b7965d4View commit details
Commits on Jan 28, 2026
-
Bump to dotnet/android-tools@604940c (dotnet#1378)
Bumps [external/xamarin-android-tools](https://github.com/xamarin/xamarin-android-tools) from `fb95edd` to `604940c`. - [Commits](dotnet/android-tools@fb95edd...604940c) --- updated-dependencies: - dependency-name: external/xamarin-android-tools dependency-version: 604940c3c74ba6af59ec06733de68d5cae306189 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Configuration menu - View commit details
-
Copy full SHA for b8f2c2b - Browse repository at this point
Copy the full SHA b8f2c2bView commit details
Commits on Feb 6, 2026
-
Bump to dotnet/android-tools@ebd3aaf (dotnet#1379)
Bumps [external/xamarin-android-tools](https://github.com/xamarin/xamarin-android-tools) from `604940c` to `ebd3aaf`. - [Commits](dotnet/android-tools@604940c...ebd3aaf) --- updated-dependencies: - dependency-name: external/xamarin-android-tools dependency-version: ebd3aaf34b6650b0d0b763f824d5ba3f2d6802e3 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Configuration menu - View commit details
-
Copy full SHA for 5d55b25 - Browse repository at this point
Copy the full SHA 5d55b25View commit details
Commits on Feb 26, 2026
-
Bump to dotnet/android-tools@062cc29 (dotnet#1380)
Bumps [external/xamarin-android-tools](https://github.com/xamarin/xamarin-android-tools) from `ebd3aaf` to `062cc29`. - [Commits](dotnet/android-tools@ebd3aaf...062cc29) --- updated-dependencies: - dependency-name: external/xamarin-android-tools dependency-version: 062cc29eeeb3807fa1baffa035a0ae063ea327d1 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Configuration menu - View commit details
-
Copy full SHA for c838701 - Browse repository at this point
Copy the full SHA c838701View commit details -
Bump to dotnet/android-tools@c6fc83d (dotnet#1381)
Bumps [external/xamarin-android-tools](https://github.com/xamarin/xamarin-android-tools) from `062cc29` to `c6fc83d`. - [Commits](dotnet/android-tools@062cc29...c6fc83d) --- updated-dependencies: - dependency-name: external/xamarin-android-tools dependency-version: c6fc83d94d08e6431e5415c327149912fdb77efa dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Configuration menu - View commit details
-
Copy full SHA for ca0f7f0 - Browse repository at this point
Copy the full SHA ca0f7f0View commit details
Commits on Mar 2, 2026
-
Bump to dotnet/android-tools@e0a9393 (dotnet#1382)
Bumps [external/xamarin-android-tools](https://github.com/xamarin/xamarin-android-tools) from `c6fc83d` to `e0a9393`. - [Commits](dotnet/android-tools@c6fc83d...e0a9393) --- updated-dependencies: - dependency-name: external/xamarin-android-tools dependency-version: e0a93933dd513a3fa2fd1d37940ae5f5f005955a dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Configuration menu - View commit details
-
Copy full SHA for b57f4e3 - Browse repository at this point
Copy the full SHA b57f4e3View commit details
Commits on Mar 3, 2026
-
Bump dotnet/android-tools@6a6de1f (dotnet#1383)
Bumps [external/xamarin-android-tools](https://github.com/xamarin/xamarin-android-tools) from `e0a9393` to `6a6de1f`. - [Commits](dotnet/android-tools@e0a9393...6a6de1f) --- updated-dependencies: - dependency-name: external/xamarin-android-tools dependency-version: 6a6de1f24572d93048f3bbaa997bcfcf43a472dd dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Configuration menu - View commit details
-
Copy full SHA for 9c9dcaf - Browse repository at this point
Copy the full SHA 9c9dcafView commit details
Commits on Mar 6, 2026
-
Bump to dotnet/android-tools@d3c269d (dotnet#1384)
Bumps [external/xamarin-android-tools](https://github.com/xamarin/xamarin-android-tools) from `6a6de1f` to `d3c269d`. - [Commits](dotnet/android-tools@6a6de1f...d3c269d) --- updated-dependencies: - dependency-name: external/xamarin-android-tools dependency-version: d3c269de161a9f70438ff9db6979f52868ed4d6f dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Configuration menu - View commit details
-
Copy full SHA for 2d965b7 - Browse repository at this point
Copy the full SHA 2d965b7View commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff main...main