Android framework version
net10.0-android
Affected platform version
Microsoft.Android.Sdk.Windows 36.1.53
Description
A minimal SDK-style .NET Android project that only references Xamarin.Google.Android.Material 1.14.0.3 fails during the Java compile step.
The generated Java implementor classes for the Material slider listener interfaces are emitted without method implementations:
public class BaseOnChangeListenerImplementor
extends java.lang.Object
implements
mono.android.IGCUserPeer,
com.google.android.material.slider.BaseOnChangeListener
{
public static final String __md_methods;
static {
__md_methods =
"";
mono.android.Runtime.register ("Google.Android.Material.Slider.IBaseOnChangeListenerImplementor, Xamarin.Google.Android.Material", BaseOnChangeListenerImplementor.class, __md_methods);
}
}
javap on the packaged AAR shows the Java interfaces still require abstract methods:
public interface com.google.android.material.slider.BaseOnChangeListener<S> {
public abstract void onValueChange(S, float, boolean);
}
public interface com.google.android.material.slider.BaseOnSliderTouchListener<S> {
public abstract void onStartTrackingTouch(S);
public abstract void onStopTrackingTouch(S);
}
Expected behavior: the package builds, or the generated implementors include the required listener methods.
Actual behavior: javac rejects the generated implementors because they implement the Material slider listener interfaces but do not override the required abstract methods.
Steps to Reproduce
- Create a new SDK-style .NET Android project targeting
net10.0-android.
- Add only this package reference:
<PackageReference Include="Xamarin.Google.Android.Material" Version="1.14.0.3" />
- Run:
Did you find any workaround?
Downgrading the package to Xamarin.Google.Android.Material 1.13.0.2 builds successfully in the same repro project:
dotnet build .\MaterialSliderBindingRepro.csproj -p:MaterialPackageVersion=1.13.0.2
I have not found a workaround that allows 1.14.0.3 to build.
Relevant log output
obj\Debug\net10.0-android\android\src\mono\com\google\android\material\slider\BaseOnChangeListenerImplementor.java(4,8): javac.exe error JAVAC0000: error: BaseOnChangeListenerImplementor is not abstract and does not override abstract method onValueChange(Object,float,boolean) in BaseOnChangeListener
obj\Debug\net10.0-android\android\src\mono\com\google\android\material\slider\BaseOnSliderTouchListenerImplementor.java(4,8): javac.exe error JAVAC0000: error: BaseOnSliderTouchListenerImplementor is not abstract and does not override abstract method onStopTrackingTouch(Object) in BaseOnSliderTouchListener
C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\36.1.53\tools\Xamarin.Android.Javac.targets(161,5): error XAJVC0000: obj\Debug\net10.0-android\android\src\mono\com\google\android\material\slider\BaseOnChangeListenerImplementor.java:4: error: BaseOnChangeListenerImplementor is not abstract and does not override abstract method onValueChange(Object,float,boolean) in BaseOnChangeListener
C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\36.1.53\tools\Xamarin.Android.Javac.targets(161,5): error XAJVC0000: obj\Debug\net10.0-android\android\src\mono\com\google\android\material\slider\BaseOnSliderTouchListenerImplementor.java:4: error: BaseOnSliderTouchListenerImplementor is not abstract and does not override abstract method onStopTrackingTouch(Object) in BaseOnSliderTouchListener
Android framework version
net10.0-android
Affected platform version
Microsoft.Android.Sdk.Windows36.1.53Description
A minimal SDK-style .NET Android project that only references
Xamarin.Google.Android.Material1.14.0.3fails during the Java compile step.The generated Java implementor classes for the Material slider listener interfaces are emitted without method implementations:
javapon the packaged AAR shows the Java interfaces still require abstract methods:Expected behavior: the package builds, or the generated implementors include the required listener methods.
Actual behavior: javac rejects the generated implementors because they implement the Material slider listener interfaces but do not override the required abstract methods.
Steps to Reproduce
net10.0-android.Did you find any workaround?
Downgrading the package to
Xamarin.Google.Android.Material1.13.0.2builds successfully in the same repro project:I have not found a workaround that allows
1.14.0.3to build.Relevant log output