MultiDex issue: java.lang.ClassNotFoundException: Didn't find class on path: DexPathList
<p>I am facing an issue with my app:
If I deactivate within Android Studio Instant Run, my app crashes upon startup with the stacktrace:</p>

<pre><code>12-29 13:36:37.876 4549-4549/com.mycoolapp.debug E/AndroidRuntime: FATAL EXCEPTION: main
                                                                              Process: com.mycoolapp.debug, PID: 4549
                                                                              java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.mycoolapp.debug/com.myapp.SplashScreenActivity}: java.lang.ClassNotFoundException: Didn't find class "com.myapp.SplashScreenActivity" on path: DexPathList[[zip file "/system/framework/android.test.runner.jar", zip file "/data/app/com.mycoolapp.debug-2/base.apk"],nativeLibraryDirectories=[/data/app/com.mycoolapp.debug-2/lib/arm, /vendor/lib, /system/lib]]
                                                                                  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2216)
                                                                                  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2365)
                                                                                  at android.app.ActivityThread.access$800(ActivityThread.java:148)
                                                                                  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1283)
                                                                                  at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                                  at android.os.Looper.loop(Looper.java:135)
                                                                                  at android.app.ActivityThread.main(ActivityThread.java:5272)
                                                                                  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:909)
                                                                                  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:704)
                                                                               Caused by: java.lang.ClassNotFoundException: Didn't find class "com.myapp.SplashScreenActivity" on path: DexPathList[[zip file "/system/framework/android.test.runner.jar", zip file "/data/app/com.mycoolapp.debug-2/base.apk"],nativeLibraryDirectories=[/data/app/com.mycoolapp.debug-2/lib/arm, /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.newActivity(Instrumentation.java:1065)
                                                                                  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2206)
                                                                                  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2365) 
                                                                                  at android.app.ActivityThread.access$800(ActivityThread.java:148) 
                                                                                  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1283) 
                                                                                  at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                                                  at android.os.Looper.loop(Looper.java:135) 
                                                                                  at android.app.ActivityThread.main(ActivityThread.java:5272) 
                                                                                  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:909) 
                                                                                  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:704) 
                                                                                Suppressed: java.lang.NoClassDefFoundError: com.myapp.SplashScreenActivity
                                                                                  at dalvik.system.DexFile.defineClassNative(Native Method)
                                                                                  at dalvik.system.DexFile.defineClass(DexFile.java:226)
                                                                                  at dalvik.system.DexFile.loadClassBinaryName(DexFile.java:219)
                                                                                  at dalvik.system.DexPathList.findClass(DexPathList.java:321)
                                                                                  at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:54)
                                                                                        ... 14 more
                                                                                Suppressed: java.lang.ClassNotFoundException: com.myapp.SplashScreenActivity
                                                                                  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>As far as I have researched this belongs to multidex:
<a href="https://developer.android.com/studio/build/multidex.html" rel="nofollow noreferrer">https://developer.android.com/studio/build/multidex.html</a></p>

<p>Even if I add the multiDexEnabled property to my gradle config the app crashes. Only if I enable InstantRun (which enables multidex in background), the app runs...
If I create an apk the installation works, but the app crashes on startup with the same error.</p>

<p>Since I have as minSDK API Level 21, there should be no other change except of the multiDexEnabled property necessary, right?</p>