Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Symbol Not Found On OnActionExpandListener

I'm adding v4 support to my android application supporting gingerbread and up. I added ActionBarSherlock, which references Xamarin.Android.Support.v4. There is also a reference 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'm getting an error I can't get past, which is:

/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 happening? How can it be resolved?

like image 245
Brian Mains Avatar asked Jan 28 '14 02:01

Brian Mains


2 Answers

You can't reference both Xamarin.Android.Support.V4 and Mono.Android.Support.V4.

I'd suggest referencing just Xamarin.Android.Support.V4 as it is the updated binding to the Android Support Library v4. Remove Mono.Android.Support.V4 and android-support-v4.jar.

like image 191
Tom Opgenorth Avatar answered Nov 16 '22 17:11

Tom Opgenorth


I had the exact same problem using Xamarin studio after switching my solution to work with Xamarin Forms instead of native android.

What did the trick for me and solved it was to clean my project and rebuild (Build --> Clean All) Good luck!

like image 3
baraka Avatar answered Nov 16 '22 19:11

baraka