You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Xamarin.AndroidX.Compose.Material3] Stop stripping @Composable functions on top of the existing 265 bound types #1417
Unlike the other Compose NuGets, Xamarin.AndroidX.Compose.Material3Android already binds ~265 real types — it''s almost a real binding. The remaining gap is that every @Composable function (Text, Button, Card, Scaffold, ...) is stripped, so the public Material3 API is unreachable from C#.
Option A (metadata only — short-term win): strip the Method-<hash> mangled siblings via per-overload <remove-node> so the rest of the Material3 API surfaces cleanly, and document the raw-JNI calling convention for the @Composable functions. Compose''s $default bitmask convention (set bit to "use the default") lets callers pass null for inline-class params with the function picking defaults — compose-net''s sample does exactly this for Button and Text.
Option B (generator change — long-term win): extend class-parse to demangle name-<hash> siblings as overloads of name and project inline-class params as their underlying primitive types (Color → long, Dp → float, etc.). This makes Button(...) / Text(...) directly callable from C# without raw JNI. Larger change; would benefit any Kotlin binding using inline classes, not just Compose.
I think Option A unblocks shipping; Option B is the right north star. Reasonable to land A now and track B separately.
Requested change (Option A)
Drop the package-wide / @Composable-function strips from the Material3 recipe''s Transforms/Metadata.xml (whichever form they currently take — the existing 265 bound types prove it''s not a path="/api/package" strip; it''s more targeted).
Document the raw-JNI calling pattern for the stripped overloads in the NuGet''s README (compose-net''s ComposeNet.Compose/ComposeBridges.cs has the working pattern).
Regenerate api/PublicApi*.txt.
Sequencing
Depends on the Runtime issue (everyone does). Independent of the UI/Foundation issue but lands after for review-load reasons.
Closing after investigating whether we can intervene from this repo without waiting on the upstream generator change.
What I confirmed
The hash-mangled @Composable methods (Text--4IGK_g, Button-LPr_se0, …) are present in api.xml.class-parse with synthetic="true".
They are stripped by Xamarin.Android.Tools.ApiXmlAdjuster (JavaApiNonBindableStripper) before Metadata.xml transforms ever run, so <remove-node> / <attr> entries in this repo cannot reach them.
The save condition in the adjuster is effectively: drop when ExtendedSynthetic == true && BaseMethod == null.
There is a hookable MSBuild seam between _ExportJarToXml and GenerateBindings (injectable via source/_PackageLevelCustomizations.cshtml) where an XmlPoke step could copy methods back into api.xml with synthetic="false".
Why a downstream fix isn't worth shipping
Even after un-stripping the methods, the binding generator still can't produce a usable C# surface for them:
Signature collisions — many hash variants share a C#-erased signature (CS0111). A per-overload managed-name scheme would have to be invented here; it doesn't exist in this repo today.
Runtime contract — calling these methods requires the Compose runtime's $composer / $changed bitmask plumbing, which a generated wrapper won't synthesize.
This is why compose-net ships hand-written raw-JNI bridges (ComposeBridges.cs) rather than relying on generated bindings.
Path forward
The real fix is the generator-level work tracked in dotnet/android#11844. Once that lands, this repo can pick it up via an Android SDK bump and a nugetVersion bump for Xamarin.AndroidX.Compose.Material3Android (no source changes required).
If consumers need specific composables before dotnet/android#11844 ships, the unblocking pattern is a separate hand-written facade package (compose-net-style), not changes inside this binding project.
Activity
Document Material3 @composable gap (#1417)
jonathanpeppers commentedon May 22, 2026
Closing after investigating whether we can intervene from this repo without waiting on the upstream generator change.
What I confirmed
@Composablemethods (Text--4IGK_g,Button-LPr_se0, …) are present inapi.xml.class-parsewithsynthetic="true".Xamarin.Android.Tools.ApiXmlAdjuster(JavaApiNonBindableStripper) beforeMetadata.xmltransforms ever run, so<remove-node>/<attr>entries in this repo cannot reach them.ExtendedSynthetic == true && BaseMethod == null._ExportJarToXmlandGenerateBindings(injectable viasource/_PackageLevelCustomizations.cshtml) where anXmlPokestep could copy methods back intoapi.xmlwithsynthetic="false".Why a downstream fix isn't worth shipping
Even after un-stripping the methods, the binding generator still can't produce a usable C# surface for them:
managed-namescheme would have to be invented here; it doesn't exist in this repo today.Composer,Modifier,TextStyle,Function0<Unit>, etc., aren't cleanly bindable.$composer/$changedbitmask plumbing, which a generated wrapper won't synthesize.This is why compose-net ships hand-written raw-JNI bridges (
ComposeBridges.cs) rather than relying on generated bindings.Path forward
The real fix is the generator-level work tracked in dotnet/android#11844. Once that lands, this repo can pick it up via an Android SDK bump and a
nugetVersionbump forXamarin.AndroidX.Compose.Material3Android(no source changes required).If consumers need specific composables before dotnet/android#11844 ships, the unblocking pattern is a separate hand-written facade package (compose-net-style), not changes inside this binding project.