title: NoClassDefFoundError when creating non-final non-static classes
body: <p>I am getting the following exception when trying to use the code from Andriod-SocialButtons project (<a href="https://github.com/championswimmer/Android-SocialButtons" rel="nofollow noreferrer">https://github.com/championswimmer/Android-SocialButtons</a>):</p>
  
  <pre><code>I/art: Rejecting re-init on previously-failed class java.lang.Class&lt;in.championswimmer.libsocialbuttons.BtnSocial&gt;
  java.lang.NoClassDefFoundError: in.championswimmer.libsocialbuttons.BtnSocial
      at java.lang.Class.classForName(Native Method)
      at java.lang.Class.forName(Class.java:308)
      at java.lang.Class.forName(Class.java:272)
      at XXX.onCreate(XXXActivity.java:76)
      at android.app.Activity.performCreate(Activity.java:5937)
      at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2251)
      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360)
      at android.app.ActivityThread.access$800(ActivityThread.java:144)
      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
      at android.os.Handler.dispatchMessage(Handler.java:102)
      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>Here's my code snippet:</p>
  
  <pre><code>Class c;
  c = in.championswimmer.libsocialbuttons.Utils.class;
  c = in.championswimmer.libsocialbuttons.BuildConfig.class;
  c = in.championswimmer.libsocialbuttons.BtnSocial.class;
  c = in.championswimmer.libsocialbuttons.SocialFab.class;
  </code></pre>
  
  <p>The first 3 lines in this snippet execute fine but I try to access the BtnSocial or SocialFab classes it throws NoClassDefFoundError.</p>
  
  <p>It might be relevant that BtnSocial and SocialFab classes don't contain any static or final fields or methods.</p>
  
  <p>I am using Android Studio to develop &amp; run my application</p>
  
  <p>This is my project <code>build.gradle</code>:</p>
  
  <pre><code>buildscript {
      repositories {
          jcenter()
          google()
      }
      dependencies {
          classpath 'com.android.tools.build:gradle:3.0.1'
      }
  }
  
  allprojects {
      repositories {
          jcenter()
          google()
      }
  }
  </code></pre>
  
  <p>and my app's build.gradle:</p>
  
  <pre><code>buildscript {
      repositories {
          maven { url 'https://maven.fabric.io/public' }
      }
  
      dependencies {
          classpath 'io.fabric.tools:gradle:1.22.0'
      }
  }
  apply plugin: 'com.android.application'
  apply plugin: 'io.fabric'
  
  repositories {
      maven { url 'https://maven.fabric.io/public' }
      maven { url "https://jitpack.io" }
  }
  
  android {
      ...
      compileSdkVersion 25
      buildToolsVersion "26.0.2"
      defaultConfig {
          applicationId "XXX"
          minSdkVersion 16
          targetSdkVersion 23
          versionCode 9
          versionName "2.4"
          useLibrary 'org.apache.http.legacy'
      }
      buildTypes {
          ...
      }
  }
  
  dependencies {
      ...
      compile 'com.android.support:support-v4:25.0.1'
      compile 'com.google.code.gson:gson:1.7.1'
      compile 'com.google.android.gms:play-services-auth:11.8.0'
      compile 'com.github.championswimmer:Android-SocialButtons:1.5.0'
      ...
  }
  </code></pre>
  
  <p>I am following Android-SocialButtons's docs exactly: <a href="https://github.com/championswimmer/Android-SocialButtons/blob/master/README.md" rel="nofollow noreferrer">https://github.com/championswimmer/Android-SocialButtons/blob/master/README.md</a> . What am I dong wrong?</p>