title: : Unable to instantiate application and ClassNotFound while sharing apk
body: <p>when i run the app from android studio it runs fine in simulator and device.</p>
  
  <p>but when i share the debug / release version of apk it got crashed when user taps on a app icon.</p>
  
  <p>following the error that i can see in logs </p>
  
  <pre><code>03-11 09:16:12.654 25384-25384/com.microtechnicianapp E/AndroidRuntime: FATAL EXCEPTION: main
        Process: com.microtechnicianapp, PID: 25384
        java.lang.RuntimeException: Unable to instantiate application com.microtechnicianapp.App: java.lang.ClassNotFoundException: Didn't find class "com.microtechnicianapp.App" on path: DexPathList[[zip file "/data/app/com.microtechnicianapp-1/base.apk"],nativeLibraryDirectories=[/data/app/com.microtechnicianapp-1/lib/x86, /vendor/lib, /system/lib]]
            at android.app.LoadedApk.makeApplication(LoadedApk.java:563)
            at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4491)
            at android.app.ActivityThread.access$1500(ActivityThread.java:144)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1339)
            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)
         Caused by: java.lang.ClassNotFoundException: Didn't find class "com.microtechnicianapp.App" on path: DexPathList[[zip file "/data/app/com.microtechnicianapp-1/base.apk"],nativeLibraryDirectories=[/data/app/com.microtechnicianapp-1/lib/x86, /vendor/lib, /system/lib]]
            at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
            at android.app.Instrumentation.newApplication(Instrumentation.java:979)
            at android.app.LoadedApk.makeApplication(LoadedApk.java:558)
            at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4491) 
            at android.app.ActivityThread.access$1500(ActivityThread.java:144) 
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1339) 
            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) 
          Suppressed: java.lang.ClassNotFoundException: com.microtechnicianapp.App
            at java.lang.Class.classForName(Native Method)
            at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
            at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
                  ... 13 more
         Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
  </code></pre>
  
  <p>have read lot of threads but nothing works for me since morning. </p>
  
  <p>have tried lot of things in gradle </p>
  
  <pre><code>apply plugin: 'com.android.application' apply plugin: 'com.neenbedankt.android-apt' apply plugin: 'realm-android' android {
      compileSdkVersion 25
      buildToolsVersion '25.0.0'
      defaultConfig {
          applicationId "com.microtechnicianapp"
          minSdkVersion 19
          targetSdkVersion 24
          versionCode 1
          versionName "1.2"
          testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
  
      }
      buildTypes {
          release {
              minifyEnabled false
              shrinkResources true
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
          debug {
              minifyEnabled true
              shrinkResources true
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
      }
  
      dexOptions {
          preDexLibraries false
      } } repositories {
      maven {
          url  "http://dl.bintray.com/lukaville/maven"
      } }
  
  
  
  
  dependencies {
      compile fileTree(include: ['*.jar'], dir: 'libs')
      androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
          exclude group: 'com.android.support', module: 'support-annotations'
      })
      compile 'com.android.support:design:25.0.0'
      compile 'com.squareup.retrofit2:retrofit:2.1.0'
      compile 'com.bluelinelabs:logansquare:1.3.6'
      compile 'com.github.aurae.retrofit2:converter-logansquare:1.4.1'
      compile 'org.greenrobot:eventbus:3.0.0'
      compile 'com.google.firebase:firebase-messaging:9.8.0'
      compile 'com.google.android.gms:play-services-maps:9.8.0'
      compile 'com.google.android.gms:play-services-location:9.8.0'
      compile 'com.github.gcacace:signature-pad:1.2.0'
      compile 'com.github.davidpizarro:autolabelui:1.0.1'
      compile 'com.nbsp:library:1.1'
      compile 'com.journeyapps:zxing-android-embedded:3.2.0@aar'
      compile 'com.google.zxing:core:3.2.1'
      testCompile 'junit:junit:4.12'
      apt 'com.bluelinelabs:logansquare-compiler:1.3.6'
      compile 'com.google.android.gms:play-services-appindexing:9.8.0'
      compile 'com.mikhaellopez:circularprogressbar:1.1.1'
      compile 'com.android.support:multidex:1.0.0'
  
  
  }
  
  
  apply plugin: 'com.google.gms.google-services'
  </code></pre>
  
  <p>I am using <code>android studio 2.3</code> hence gradle version is <code>gradle-3.3-all.zip</code></p>