title: NoClassDefFoundError for Jersey 2.4.1 client in Android
body: <p>I have an Android project targeting API 17 which needs to consume a Jersey 2.4.1 REST service. However, at runtime I keep getting a NoClassDefFoundError for <code>org.glassfish.jersey.model.internal.CommonConfig$1</code>. This class is in the Jersey JAR files I need for the client code.</p>
  
  <p>I have followed instructions from other posts about the libs Android dependency fix e.g. <a href="https://stackoverflow.com/questions/9870995/android-java-lang-noclassdeffounderror">Android java.lang.NoClassDefFoundError</a> but I still get the issue. The JAR is in the libs dir and I have checked the export option in the build path. What's weird is I have other jersey jars in this lib which are working, it just doesn't seem to find this one.</p>
  
  <p>I have tried cleaning the project, refreshing it, removing and re-adding the JAR but I just can't seem to get it working. The class it complains about is in the jersey-common-2.4.1.jar which I can see in the Eclipse workspace so the right JAR is there, just seems it's not being exported with the APK.</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I tried configuring ProGuard to see what gets produced but it was a never ending rabbit hole of warnings about classes and methods. In the end I just put <code>-ignorewarnings</code> in to get something output.</p>
  
  <p><strong>UPDATE2</strong></p>
  
  <p>I looked at the error message a little closer and it's actually missing <code>org.glassfish.jersey.model.internal.CommonConfig$1</code> (note the $1). This is a static inner class which makes me almost certain that it's a ProGuard config issue. I tried adding:</p>
  
  <pre><code>-keepclasseswithmembers class org.glassfish.jersey.**
  -keepclasseswithmembers class javax.ws.rs.**
  </code></pre>
  
  <p>to my proguard-project.txt file but I still get the NoClassDefFoundError. How can I tell Eclipse/ProGuard to leave my library jars alone completely for both kinds of build options (right click deploy and export)?</p>
  
  <p><strong>ANSWER/RESOLUTION</strong></p>
  
  <p>See my comment in response to @pjco.</p>