title: DEX error Android Studio - Execution failed for task ':app:transformClassesWithMultidexlistForDebug'
body: <p>I get this weird Error after adding a Spinner, it worked. I tried to fix some margin for it. Tried building it got this error</p>
  
  <p>Execution failed for task ':app:transformClassesWithMultidexlistForDebug'.
  Duplicate zip entry [classes.jar:android/support/design/widget/CoordinatorLayout$Behavior.class]</p>
  
  <p>So, I tried removing the stuff I added. Didn't work. I tried clean the build project and rebuild, no success. It tried looking for a solution on stackoverflow. I came across, added multiDexEnabled true this to my app.gradle, no success.I also followed the documentation for it on Android link: <a href="https://developer.android.com/studio/build/multidex.html" rel="nofollow noreferrer">https://developer.android.com/studio/build/multidex.html</a></p>
  
  <p>This didn't work neither, so I came here my self. My gradle files:</p>
  
  <p>app.gradle</p>
  
  <pre><code>apply plugin: 'com.android.application'
  
  android {
      compileSdkVersion 26
      defaultConfig {
          applicationId "com.example.meyil.androidlearning"
          minSdkVersion 15
          targetSdkVersion 26
          multiDexEnabled true
          versionCode 1
          versionName "1.0"
          testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
      }
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
      }
  }
  
  dependencies {
      implementation fileTree(dir: 'libs', include: ['*.jar'])
      implementation 'com.android.support:appcompat-v7:26.1.0'
      implementation 'com.android.support.constraint:constraint-layout:1.0.2'
      implementation 'com.google.firebase:firebase-auth:11.8.0'
      implementation 'com.google.firebase:firebase-messaging:11.8.0'
      implementation 'com.android.support:support-v4:26.1.0'
      implementation 'com.google.firebase:firebase-database:11.8.0'
      implementation 'com.google.firebase:firebase-storage:11.8.0'
      testImplementation 'junit:junit:4.12'
      androidTestImplementation 'com.android.support.test:runner:1.0.1'
      androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
      implementation 'com.android.support:design:26.1.0'
      implementation 'de.hdodenhof:circleimageview:2.2.0'
      implementation 'com.theartofdev.edmodo:android-image-cropper:2.6.+'
      implementation 'com.squareup.picasso:picasso:2.5.2'
      implementation 'com.firebaseui:firebase-ui-database:3.2.1'
      implementation 'id.zelory:compressor:2.1.0'
      implementation 'com.squareup.okhttp:okhttp:2.5.0'
      implementation 'com.android.support:multidex:1.0.2'
  }
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  apply plugin: 'com.google.gms.google-services'
  </code></pre>
  
  <p>AndroidManifest.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.example.meyil.androidlearning"&gt;
  
      &lt;uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /&gt;
      &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /&gt;
  
      &lt;application
          android:name="android.support.multidex.MultiDexApplication"
          android:allowBackup="true"
          android:icon="@mipmap/spaced_launcher_logo"
          android:label="@string/app_name"
          android:roundIcon="@mipmap/spaced_launcher_logo_round"
          android:supportsRtl="true"
          android:theme="@style/AppTheme"&gt;
          &lt;service android:name=".FirebaseMessagingService"&gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="com.google.firebase.MESSAGING_EVENT" /&gt;
              &lt;/intent-filter&gt;
          &lt;/service&gt;
  
          &lt;activity android:name=".MainActivity"&gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.MAIN" /&gt;
  
                  &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
          &lt;activity android:name=".StartActivity" /&gt;
          &lt;activity
              android:name=".RegisterActivity"
              android:parentActivityName=".StartActivity" /&gt;
          &lt;activity
              android:name=".LoginActivity"
              android:parentActivityName=".StartActivity" /&gt;
          &lt;activity android:name=".SettingsActivity" /&gt;
          &lt;activity
              android:name=".StatusActivity"
              android:parentActivityName=".SettingsActivity" /&gt;
          &lt;activity
              android:name="com.theartofdev.edmodo.cropper.CropImageActivity"
              android:theme="@style/Base.Theme.AppCompat" /&gt;
          &lt;activity
              android:name=".UsersActivity"
              android:parentActivityName=".MainActivity" /&gt;
          &lt;activity android:name=".ProfileActivity"&gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="com.example.meyil.androidlearning_TARGET_NOTIFICATION" /&gt;
  
                  &lt;category android:name="android.intent.category.DEFAULT" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
          &lt;activity android:name=".ChatActivity"
              android:parentActivityName=".MainActivity"&gt;&lt;/activity&gt;
      &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>
  
  <p>build.gradle</p>
  
  <pre><code>// Top-level build file where you can add configuration options common to all sub-projects/modules.
  
  buildscript {
  
      repositories {
          google()
          jcenter()
      }
      dependencies {
          classpath 'com.android.tools.build:gradle:3.0.1'
  
  
          // NOTE: Do not place your application dependencies here; they belong
          // in the individual module build.gradle files
          classpath 'com.google.gms:google-services:3.1.0'
      }
  }
  
  allprojects {
      repositories {
          google()
          jcenter()
      }
  }
  
  task clean(type: Delete) {
      delete rootProject.buildDir
  }
  </code></pre>