Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

ShellItemRenderer.java - Error when building Android Solution #14492

Closed
kerberosargos opened this issue Jul 11, 2021 · 30 comments
Closed

ShellItemRenderer.java - Error when building Android Solution #14492

kerberosargos opened this issue Jul 11, 2021 · 30 comments

Comments

@kerberosargos
Copy link

Hello after update Xamarin.Android bindings for AndroidX package from 1.3.0.1 to 1.4.0 it gives error as following in build Android Solution time. There is no problem in version 1.3.0.1

Error error: ShellItemRenderer is not abstract and does not override abstract method onNavigationItemSelected(MenuItem) in OnItemSelectedListener
public class ShellItemRenderer My.Android c:\ShellItemRenderer.java 4

Error error: TabbedPageRenderer is not abstract and does not override abstract method onNavigationItemSelected(MenuItem) in OnItemSelectedListener
public class TabbedPageRenderer My.Android C:\TabbedPageRenderer.java 4 
@AbdeslamARAJ
Copy link

I have same issue

@Mobisma
Copy link

Mobisma commented Jul 12, 2021

Same here

@amun1000
Copy link

I have same issue - VS 16.10.3, XF 5.0

@ahoke-cr
Copy link

Reverting package updates to Xamarin.Google.Android.Material from 1.4 -> 1.3.0.1 seems to have fixed this error for me. Your mileage may vary, but you may be able to maintain other version 1.4 references with the aforementioned package left behind at 1.3.0.1.

I am also using VS 16.10.3 with Xamarin.Forms 5.0.0.2083 (r4)

@mikebikerider
Copy link

Me too.
VS2019 16.10.3
Xamarin.Forms 5.0.0.2083
Target Android version API Level 30 - R
Same 2 errors as reported in the original post.

@sk1llsh0t
Copy link

I'm getting the same error. reverting to older version until fixed.

@fjgsanandres
Copy link

Me too.
VS for Mac 8.10.6
Xamarin.Forms 5.0.0.2083
Target Android version API Level 27, 28 and 29
Same 2 errors as reported in the original post.

Error JAVAC0000:  error: ShellItemRenderer is not abstract and does not override abstract method onNavigationItemSelected(MenuItem) in OnItemSelectedListener
public class ShellItemRenderer

Error JAVAC0000:  error: TabbedPageRenderer is not abstract and does not override abstract method onNavigationItemSelected(MenuItem) in OnItemSelectedListener
public class TabbedPageRenderer

@lomdar67
Copy link

Same here...

@hyungkyulee
Copy link

hyungkyulee commented Jul 27, 2021


My case was error started from the change the deprecated AndroidX.AppCompat to new package.
Firstly, I removed 'Xamarin.AndroidX.AppCompat.Resources 1.x.x', and Re-Installed the new package: Xamarin.AndroidX.AppCompat.AppCompatResources v1.3.0.
On panic, Ahoke-cr 's solution (above) was working perfectly.

Downgrade 'Xamarin.Google.Android.Material' from 1.4 -> 1.3.0.1.
Thanks..

@nickpeppers
Copy link

Still an issue in 1.4.0.1 as well

@henda79
Copy link

henda79 commented Jul 31, 2021

I had this issue too but I never had the Xamarin.Google.Android.Material package installed. Anyway, I installed version 1.3.0.1 and it compiled ?!?

@MagicAndre1981
Copy link
Contributor

Still an issue in 1.4.0.1 as well

the .1 only adds .net6-android as target and changed nothing else.

@Orgbrat
Copy link

Orgbrat commented Aug 2, 2021

This is still an issue even with all the AndroidX latest updates. Reverting package updates to Xamarin.Google.Android.Material from 1.4.0.1 -> 1.3.0.1 seems to have fixed this error for me.

@npagare
Copy link

npagare commented Aug 2, 2021

I have the same issue.

Same true for TabbedPageRenderer -

TabbedPageRenderer is not abstract and does not override abstract method onNavigationItemSelected(MenuItem) in OnItemSelectedListener

@jpobst
Copy link

jpobst commented Aug 4, 2021

Looks like the issue is that Google added a new interface, added it to the existing interface, and moved the OnNavigationItemSelected method to it:

Material 1.3:

public interface IOnNavigationItemSelectedListener : IJavaObject, IDisposable, IJavaPeerable
{
  bool OnNavigationItemSelected(IMenuItem item);
}

Material 1.4:

[Obsolete("This class is obsoleted in this android platform")]
public interface IOnNavigationItemSelectedListener : NavigationBarView.IOnItemSelectedListener, IJavaObject, IDisposable, IJavaPeerable
{
}

public interface NavigationBarView.IOnItemSelectedListener : IJavaObject, IDisposable, IJavaPeerable
{
  bool OnNavigationItemSelected(IMenuItem p0);
}

This may (?) be a binary compatible change in Java, but it is not in C#.

I think XF/Maui will need to release a new version that is built against Material 1.4+, and specifies 1.4 as a minimum dependency.

That is, XF and the user app must be both compiled with 1.3 or earlier, or 1.4+. The issue now is that XF is compiled against 1.3, but the user app is compiled against (and shipping) 1.4.

The workaround for now is that users must continue to use Material 1.3 with the current version of XF.

@jpobst
Copy link

jpobst commented Aug 5, 2021

Maui has a PR they are working on to fix it there:
dotnet/maui#1927

Xamarin.Forms will need something similar, so I'm going to transfer this issue to that repo so they can track it.

@jpobst jpobst transferred this issue from xamarin/AndroidX Aug 5, 2021
@jpobst jpobst added this to New in Triage via automation Aug 5, 2021
@paulocarinhena
Copy link

Me too.

@MagicAndre1981
Copy link
Contributor

Me too.

you need to wait until #14506 is merged and SR5 is out

@zipgenius
Copy link

This is still an issue in v. 1.4.0.2
The only workaround is to downgrade to 1.3.0.1

@MagicAndre1981
Copy link
Contributor

This is still an issue in v. 1.4.0.2
The only workaround is to downgrade to 1.3.0.1

read my comment below, you need to wait until the mentioned RP is merged into XF and SR5 gets released.

@jsuarezruiz jsuarezruiz moved this from New to Ready For Work in Triage Sep 7, 2021
@kissurda
Copy link

Hi,

5.0.0.2125 update is works for me.

Thx

@npagare
Copy link

npagare commented Sep 21, 2021

Hi,

5.0.0.2125 update is works for me.

Thx

Ditto.

@jfversluis
Copy link
Member

Looks like this is resolved now, thanks!

Triage automation moved this from Ready For Work to Closed Oct 4, 2021
@Alexunskilled
Copy link

I had this issue too but I never had the Xamarin.Google.Android.Material package installed. Anyway, I installed version 1.3.0.1 and it compiled ?!?

Thank you, this helped me. Weird though, since We never installed this.

@DjeeBay
Copy link

DjeeBay commented Oct 27, 2021

By using NavigationItemSelected on Xamarin.Forms 5.0.0.2196 and Xamarin.Google.Android.Material 1.3.0.1
I got : Error XA4204: Unable to resolve interface type 'Google.Android.Material.Navigation.NavigationBarView/IOnItemSelectedListener'. Are you missing an assembly reference? (XA4204)

Anybody knows how to solve this ?

@MagicAndre1981
Copy link
Contributor

By using NavigationItemSelected on Xamarin.Forms 5.0.0.2196 and Xamarin.Google.Android.Material 1.3.0.1

Anybody knows how to solve this ?

5.0.0.2196 depends on Xamarin.Google.Android.Material in Version 1.4.x

@alexmartinezm
Copy link

Can you please ping me when this is fixed on Xamarin.Forms 5.0.0.2244? Thanks...

@Codelisk
Copy link

Still not fixed

@ClumsyPenguin
Copy link

Updating Xamarin.Forms to 5.0.0.2401 and then explicitly updated both Xamarin.Android to 1.7.0.2 and Xamarin.Google.Android.Material 1.5.0.2 fixed it for me

@suchithm
Copy link

suchithm commented Jun 1, 2022

Updating Xamarin.Forms to 5.0.0.2401 and then explicitly updated both Xamarin.Android to 1.7.0.2 and Xamarin.Google.Android.Material 1.5.0.2 fixed it for me

Fixed with this particular versions

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Triage
  
Closed
Development

No branches or pull requests