title: Jar library is not loaded DURING RUNTIME in Android Studio
body: <p>This is utterly frustrating...Any help is greatly appreciated.</p>
  
  <p>Please don't assume that I haven't referred to previous posts on this issue. I did and tried all the suggestions made in those posts to fix this issue several times, but to no avail, though others have posted it worked for them.</p>
  
  <p>Here is the problem.</p>
  
  <p>I added two jar files that are the implementation of json-rpc2 protocol. They are downloaded from the following location.</p>
  
  <p><a href="http://software.dzhuvinov.com//download.html#download-jsonrpc2client" rel="nofollow">http://software.dzhuvinov.com//download.html#download-jsonrpc2client</a></p>
  
  <p>The library files are:</p>
  
  <p>jsonrpc2-base-1.35.jar
  jsonrpc2-client-1.14.4.jar</p>
  
  <p>I added them to libs folder and then added those libraries by right clicking on them within the studio. I added the dependencies in build.gradle of my project. I cleaned and built the project. Please note all this time the library references were recognized by the compiler and build was successful. Now comes the problem... The same libraries that were properly recognized during coding and during compilation, WOULD NOT WORK DURING RUN TIME. I get the following No Class Found error. Please save the remaining hair on my head. Thanks.</p>
  
  <pre><code>--------- beginning of crash
  
  com.example.admin.myapplication E/AndroidRuntime﹕ FATAL EXCEPTION: main
              Process: com.example.admin.myapplication, PID: 1877
              java.lang.NoClassDefFoundError: com.thetransactioncompany.jsonrpc2.JSONRPC2Request
                      at com.example.admin.myapplication.MainActivity.accessWebService(MainActivity.java:154)
                      at com.example.admin.myapplication.MainActivity$1.onClick(MainActivity.java:55)
                      at android.view.View.performClick(View.java:4756)
                      at android.view.View$PerformClick.run(View.java:19749)
                      at android.os.Handler.handleCallback(Handler.java:739)
                      at android.os.Handler.dispatchMessage(Handler.java:95)
                      at android.os.Looper.loop(Looper.java:135)
                      at android.app.ActivityThread.main(ActivityThread.java:5221)
                      at java.lang.reflect.Method.invoke(Native Method)
                      at java.lang.reflect.Method.invoke(Method.java:372)
                      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
                      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
  </code></pre>
  
  <p>Below is the content of build.gradle file.</p>
  
  <pre><code>apply plugin: 'com.android.application'
  android {
      compileSdkVersion 21
      buildToolsVersion "21.1.2"
  
      defaultConfig {
          applicationId "com.example.admin.myapplication"
          minSdkVersion 5
          targetSdkVersion 21
          versionCode 1
          versionName "1.0"
      }
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
      }
  }
  
  dependencies {
      compile files('libs/jsonrpc2-base-1.35.jar')
      compile files('libs/jsonrpc2-client-1.14.4.jar')
  }
  </code></pre>