title: Android studio could not find class
body: <p>I work on a project original from eclipse and imported to Android Studio 1.3. I am experiencing these two errors: </p>
  
  <pre><code>08-16 12:35:19.790    4091-4091/? E/dalvikvm﹕ Could not find class 'com.jmm.ipassion.Utils$1', referenced from method com.jmm.ipassion.Utils.registerGCM
  
  08-16 12:35:19.790    4091-4091/? E/dalvikvm﹕ Could not find class 'com.jmm.ipassion.Utils$2', referenced from method com.jmm.ipassion.Utils.startAnimationButton
  </code></pre>
  
  <p>No errors before I deploy to a phone for debugging. </p>
  
  <p>My gradle looks like this: </p>
  
  <pre><code>apply plugin: 'com.android.application'
  
  android {
      compileSdkVersion 22
      buildToolsVersion "21.1.2"
  
      defaultConfig {
          applicationId "com.jmm.ipassion"
          minSdkVersion 16
          targetSdkVersion 21
          multiDexEnabled true
      }
  
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android.txt'),     'proguard-rules.txt'
          }
      }
  }
  
  dependencies {
      compile fileTree(dir: 'libs', include: ['*.jar'])
      compile project(':androidUniversalImageLoadermaster')
      compile project(':mixpanelandroid')
      compile 'com.google.android.gms:play-services:+'
      compile 'com.android.support:multidex:1.0.0'
  }
  </code></pre>
  
  <p>And my <code>utils.java</code> looks like this: </p>
  
  <pre><code>08-16 12:35:19.810    4091-4091/? E/AndroidRuntime﹕ FATAL EXCEPTION: main
  Process: com.jmm.ipassion, PID: 4091
  java.lang.NoClassDefFoundError: com.nmd.libs.UtilityMain
          at com.jmm.ipassion.Utils.upLog(Utils.java:60)
          at   com.jmm.ipassion.BaseApplication.onCreate(BaseApplication.java:103)
          at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1013)
          at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4749)
          at android.app.ActivityThread.access$1600(ActivityThread.java:172)
          at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1368)
          at android.os.Handler.dispatchMessage(Handler.java:102)
          at android.os.Looper.loop(Looper.java:146)
          at android.app.ActivityThread.main(ActivityThread.java:5653)
          at java.lang.reflect.Method.invokeNative(Native Method)
          at java.lang.reflect.Method.invoke(Method.java:515)
          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291)
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107)
          at dalvik.system.NativeStart.main(Native Method)
  </code></pre>
  
  <p>The function in <code>utils.java</code> looks like this: </p>
  
  <pre><code>public static void upLog(Context context) {
      int time = Integer.parseInt(SharedPreference.get(context, Keys.INAPP_TIME.toString(), "0"));
      SharedPreference.set(context, Keys.INAPP_TIME.toString(), String.valueOf(time+1));
      UtilityMain.isRecordLog = true;
      UtilityMain.DEBUG_D = false;
      UtilityMain.SHOW_LOG_N = true;
      UtilityMain.BUILDDAY = "20150801";
  
      UtilityMain.isUpLog = true;
      UtilityMain.start(context);
      registerGCM(context);
  }
  </code></pre>
  
  <p>I have tried almost anything regarding cleanning, rebuild, gradlew clean etc.</p>