Java.lang.NoClassDefFoundError Issue when using Android Support Design NavigationView

Rendy Del Rosario picture Rendy Del Rosario · Jan 2, 2016 · Viewed 7.3k times · Source

Getting the following issue when using NavigationView on a app:

java.lang.NoClassDefFoundError: android.support.design.internal.NavigationMenuPresenter

I got the same issue in this sample project:

https://github.com/xamarin/monodroid-samples/tree/master/android5.0/Cheesesquare

Test:

Android 5.1

Extra information:

=====================

Xamarin Studio Version 5.10.1 (build 6) Installation UUID: 4f372b0c-765f-463b-9408-1bd0211e4e94 Runtime: Mono 4.2.1 (explicit/6dd2d0d) GTK+ 2.24.23 (Raleigh theme)

Package version: 402010102 Xamarin.Profiler Not Installed

Apple Developer Tools Xcode 7.2 (9548) Build 7C68

Xamarin.Mac Not Installed

Xamarin.Android Version: 6.0.0.34 (Business Edition) Android SDK: /Users/rdelrosario/Library/Developer/Xamarin/android-sdk-mac_x86 Supported Android versions: 2.3 (API level 10) 4.0.3 (API level 15) 4.1 (API level 16) 4.2 (API level 17) 4.3 (API level 18) 4.4 (API level 19) 4.4.87 (API level 20) 5.0 (API level 21) 5.1 (API level 22) 6.0 (API level 23)

SDK Tools Version: 24.4.1 SDK Platform Tools Version: 23.1 SDK Build Tools Version: 23.0.2

Java SDK: /usr java version "1.8.0_25" Java(TM) SE Runtime Environment (build 1.8.0_25-b17) Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)

Xamarin Android Player Version: 0.6.5 Location: /Applications/Xamarin Android Player.app

Xamarin.iOS Version: 9.4.0.0 (Business Edition) Hash: 7322991 Branch: master Build date: 2015-12-08 16:20:29-0500

Build Information Release ID: 510010006 Git revision: 0b60eecdb531933734519c13257d16a780274aab Build date: 2015-12-04 20:28:20-05 Xamarin addins: 9876fd7c9837977178411ec7375b4352c0a0d6af Build lane: monodevelop-lion-cycle6-baseline

Operating System Mac OS X 10.10.5 Darwin Rendys-MacBook-Pro.local 14.5.0 Darwin Kernel Version 14.5.0 Tue Sep 1 21:23:09 PDT 2015 root:xnu-2782.50.1~1/RELEASE_X86_64 x86_64

Answer

Rendy Del Rosario picture Rendy Del Rosario · Jan 4, 2016

Fixed this issue by:

  1. Cleaned Solution
  2. Deleted projects /bin and /obj folders
  3. Deleted Android.Support.Design, Android.Support.v7.RecyclerView and zips folder in path ~/.local/share/Xamarin/
  4. Rebuild project

That's it. This forced Xamarin Studio to download and unzip the Android support files again correctly. Will take some time since needs to download the packages, should fix the issue after that.