title: NoClassDefFoundError: android.support.v7.internal.view.menu.MenuBuilder
body: <p>There is an issue with the Android appcompat v7 library on Samsung devices running Android 4.2. I keep getting crashes with the following stack trace in my Developer Console:</p>
  
  <pre><code>java.lang.NoClassDefFoundError: android.support.v7.internal.view.menu.MenuBuilder
      at android.support.v7.widget.PopupMenu.&lt;init&gt;(PopupMenu.java:66)
      at com.[my-package-name].CustomActivity$5.onClick(CustomActivity.java:215)
      at android.view.View.performClick(View.java:4222)
      at android.view.View$PerformClick.run(View.java:17620)
      at android.os.Handler.handleCallback(Handler.java:800)
      at android.os.Handler.dispatchMessage(Handler.java:100)
      at android.os.Looper.loop(Looper.java:194)
      at android.app.ActivityThread.main(ActivityThread.java:5391)
      at java.lang.reflect.Method.invokeNative(Native Method)
      at java.lang.reflect.Method.invoke(Method.java:525)
      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833)
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
      at dalvik.system.NativeStart.main(Native Method)
  </code></pre>
  
  <p>This is line 215 of CustomActivity.java:</p>
  
  <pre><code>PopupMenu popup = new PopupMenu(CustomActivity.this, mImageViewMenu);
  </code></pre>
  
  <p>The crashes come from an array of devices, but always Samsung, and always Android 4.2.</p>
  
  <p>A quick web search leads me to believe that many people have the same issue, some of the steps I have tried to solve the issue are:</p>
  
  <ul>
  <li>Check the Android project properties, make sure the appcompat library is added properly.</li>
  <li>Check the Java Build Path Order and Export project properties, make sure Android Dependencies and Android Private Libraries is checked.</li>
  <li>Confirm the class is included in the library (android.support.v7.internal.view.menu.MenuBuilder).</li>
  <li>Confirm R.java is located in gen directory for android.support.v7.appcompat.</li>
  <li>Confirm the AppCompat theme is included in the Manifest.xml activity.</li>
  <li>Clean and rebuild project.</li>
  </ul>
  
  <p>Despite these steps, and despite it working on all other devices and Android versions the crash reports still come through.</p>