Character not found on OnActionExpandListener

I am adding v4 support for my Android app supporting gingerbread and up. I added an ActionBarSherlock that references Xamarin.Android.Support.v4. There is also a link to Mono.Android.Support.v4 too. I also added the android-support-v4.jar file to the SupportLib folder and set the Build action to AndroidJavaLibrary. However, I get an error message that I cannot go through:

/obj/Debug/android/src/mono/android/support/v4/view/MenuItemCompat_OnActionExpandListenerImplementor.java(41,41): Error: cannot find symbol symbol : class OnActionExpandListener location: class android.support.v4.view.MenuItemCompat android.support.v4.view.MenuItemCompat.OnActionExpandListener 

Why is this error occurring? How can this be solved?

+7
android c # xamarin xamarin.android android-support-library
source share
2 answers

You cannot refer to either Xamarin.Android.Support.V4 or Mono.Android.Support.V4 .

I suggest referring only to Xamarin.Android.Support.V4 , as this is an updated binding to the Android v4 support library. Remove Mono.Android.Support.V4 and android-support-v4.jar .

+13
source share

I had the same problem using Xamarin studio after switching my solution to working with Xamarin Forms instead of my own android.

What a trick for me and decided this is to clean my project and rebuild (Build → Clean All) Good luck!

+3
source share

All Articles