title: Unable to show layout preview and InflateException after migrated to Android X
body: <p>This morning I decided to migrate all app to Android X to use some new feature, but I got several problems, most of it in these three layout, (activity_main.xml, app_bar_main.xml, content_main.xml)</p>
  
  <p><a href="https://i.stack.imgur.com/uqQjk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uqQjk.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/JiTtM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JiTtM.png" alt="enter image description here"></a></p>
  
  <p>When I run the app I got this errors</p>
  
  <pre><code>    2019-03-04 12:30:18.948 28112-28112/? E/AndroidRuntime: FATAL EXCEPTION: main
      Process: www.pro_cs_is.com, PID: 28112
      java.lang.RuntimeException: Unable to start activity ComponentInfo{www.pro_cs_is.com/www.pro_cs_is.com.MainActivity}: android.view.InflateException: Binary XML file line #11: Binary XML file line #2: Error inflating class CoordinatorLayout
          at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2817)
          at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2895)
          at android.app.ActivityThread.-wrap11(Unknown Source:0)
          at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1616)
          at android.os.Handler.dispatchMessage(Handler.java:106)
          at android.os.Looper.loop(Looper.java:173)
          at android.app.ActivityThread.main(ActivityThread.java:6653)
          at java.lang.reflect.Method.invoke(Native Method)
          at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:821)
       Caused by: android.view.InflateException: Binary XML file line #11: Binary XML file line #2: Error inflating class CoordinatorLayout
       Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class CoordinatorLayout
       Caused by: java.lang.ClassNotFoundException: Didn't find class "android.view.CoordinatorLayout" on path: DexPathList[[zip file "/data/app/www.pro_cs_is.com-MQHeR58522USvJ7r2TTHzQ==/base.apk", zip file "/data/app/www.pro_cs_is.com-MQHeR58522USvJ7r2TTHzQ==/split_lib_dependencies_apk.apk", zip file "/data/app/www.pro_cs_is.com-MQHeR58522USvJ7r2TTHzQ==/split_lib_resources_apk.apk", zip file "/data/app/www.pro_cs_is.com-MQHeR58522USvJ7r2TTHzQ==/split_lib_slice_0_apk.apk", zip file "/data/app/www.pro_cs_is.com-MQHeR58522USvJ7r2TTHzQ==/split_lib_slice_1_apk.apk", zip file "/data/app/www.pro_cs_is.com-MQHeR58522USvJ7r2TTHzQ==/split_lib_slice_2_apk.apk", zip file "/data/app/www.pro_cs_is.com-MQHeR58522USvJ7r2TTHzQ==/split_lib_slice_3_apk.apk", zip file "/data/app/www.pro_cs_is.com-MQHeR58522USvJ7r2TTHzQ==/split_lib_slice_4_apk.apk", zip file "/data/app/www.pro_cs_is.com-MQHeR58522USvJ7r2TTHzQ==/split_lib_slice_5_apk.apk", zip file "/data/app/www.pro_cs_is.com-MQHeR58522USvJ7r2TTHzQ==/split_lib_slice_6_apk.apk", zip file "/data/app/www.pro_cs_is.com-MQHeR58522USvJ7r2TTHzQ==/split_lib_slice_7_apk.apk", zip file "/data/app/www.pro_cs_is.com-MQHeR58522USvJ7r2TTHzQ==/split_lib_slice_8_apk.apk", zip file "/data/app/www.pro_cs_is.com-MQHeR58522USvJ7r2TTHzQ==/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/www.pro_cs_is.com-MQHeR58522USvJ7r2TTHzQ==/lib/arm64, /system/lib64, /vendor/lib64]]
          at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:125)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
          at android.view.LayoutInflater.createView(LayoutInflater.java:610)
          at android.view.LayoutInflater.onCreateView(LayoutInflater.java:707)
          at com.android.internal.policy.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:68)
          at android.view.LayoutInflater.onCreateView(LayoutInflater.java:724)
          at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:792)
          at android.view.LayoutInflater.parseInclude(LayoutInflater.java:969)
          at android.view.LayoutInflater.rInflate(LayoutInflater.java:863)
          at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:828)
          at android.view.LayoutInflater.inflate(LayoutInflater.java:519)
          at android.view.LayoutInflater.inflate(LayoutInflater.java:427)
          at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
          at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:469)
          at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:141)
          at www.pro_cs_is.com.MainActivity.onCreate(MainActivity.java:67)
          at android.app.Activity.performCreate(Activity.java:7098)
          at android.app.Activity.performCreate(Activity.java:7089)
  2019-03-04 12:30:18.949 28112-28112/? E/AndroidRuntime:     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1215)
          at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2770)
          at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2895)
          at android.app.ActivityThread.-wrap11(Unknown Source:0)
          at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1616)
          at android.os.Handler.dispatchMessage(Handler.java:106)
          at android.os.Looper.loop(Looper.java:173)
          at android.app.ActivityThread.main(ActivityThread.java:6653)
          at java.lang.reflect.Method.invoke(Native Method)
          at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:821)
          Suppressed: java.io.IOException: No original dex files found for dex location /data/app/www.pro_cs_is.com-MQHeR58522USvJ7r2TTHzQ==/split_lib_resources_apk.apk
          at dalvik.system.DexFile.openDexFileNative(Native Method)
          at dalvik.system.DexFile.openDexFile(DexFile.java:353)
          at dalvik.system.DexFile.&lt;init&gt;(DexFile.java:100)
          at dalvik.system.DexFile.&lt;init&gt;(DexFile.java:74)
          at dalvik.system.DexPathList.loadDexFile(DexPathList.java:374)
          at dalvik.system.DexPathList.makeDexElements(DexPathList.java:337)
          at dalvik.system.DexPathList.&lt;init&gt;(DexPathList.java:157)
          at dalvik.system.BaseDexClassLoader.&lt;init&gt;(BaseDexClassLoader.java:65)
          at dalvik.system.PathClassLoader.&lt;init&gt;(PathClassLoader.java:64)
          at com.android.internal.os.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java:73)
          at com.android.internal.os.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java:88)
          at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:69)
          at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:35)
          at android.app.LoadedApk.createOrUpdateClassLoaderLocked(LoadedApk.java:695)
          at android.app.LoadedApk.getClassLoader(LoadedApk.java:729)
          at android.app.LoadedApk.getResources(LoadedApk.java:956)
          at android.app.ContextImpl.createAppContext(ContextImpl.java:2282)
          at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5725)
          at android.app.ActivityThread.-wrap1(Unknown Source:0)
          at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1685)
                  ... 6 more
  </code></pre>
  
  <p><strong>build.gradle file</strong></p>
  
  <pre><code>apply plugin: 'com.android.application'
  
  android {
      compileSdkVersion 28
      defaultConfig {
          applicationId "testApp.com"
          minSdkVersion 15
          targetSdkVersion 28
          multiDexEnabled true
          versionCode 1
          versionName "1.0"
          testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
      }
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
      }
      compileOptions {
          sourceCompatibility JavaVersion.VERSION_1_8
          targetCompatibility JavaVersion.VERSION_1_8
      }
      dexOptions {
          javaMaxHeapSize "4g"
      }
      packagingOptions {
          exclude 'META-INF/proguard/androidx-annotations.pro'
      }
      dataBinding {
          enabled = true
      }
  }
  
  dependencies {
      implementation fileTree(include: ['*.jar'], dir: 'libs')
      implementation 'androidx.appcompat:appcompat:1.0.2'
      implementation 'androidx.vectordrawable:vectordrawable-animated:1.0.0'
      implementation 'androidx.exifinterface:exifinterface:1.0.0'
      implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
      implementation 'com.google.android.material:material:1.1.0-alpha04'
      implementation 'androidx.cardview:cardview:1.0.0'
      implementation 'com.google.firebase:firebase-messaging:17.4.0'
      implementation 'androidx.legacy:legacy-support-v4:1.0.0'
      testImplementation 'junit:junit:4.12'
      androidTestImplementation 'androidx.test:runner:1.1.2-alpha01'
      androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0-alpha4', {
          exclude group: 'com.google.code.findbugs'
      })
      implementation 'com.squareup.retrofit2:retrofit:2.5.0'
      implementation 'com.squareup.retrofit2:converter-gson:2.5.0'
      implementation 'com.github.bumptech.glide:glide:4.8.0'
      implementation 'org.jsoup:jsoup:1.11.3'
      implementation 'com.google.apis:google-api-services-blogger:v3-rev57-1.23.0'
      implementation 'com.squareup.picasso:picasso:2.71828'
      implementation 'com.j256.ormlite:ormlite-android:5.1'
      implementation 'com.j256.ormlite:ormlite-core:5.1'
      implementation 'org.apache.commons:commons-lang3:3.8.1'
      implementation 'com.github.ybq:Android-SpinKit:1.2.0'
      implementation 'com.google.firebase:firebase-core:16.0.7'
      implementation('com.crashlytics.sdk.android:crashlytics:2.9.8@aar') {
          transitive = true
      }
  
      implementation 'androidx.multidex:multidex:2.0.1'
      // ViewModel and LiveData
      dependencies {
          def lifecycle_version = "2.0.0"
  
          // ViewModel and LiveData
          implementation "androidx.lifecycle:lifecycle-extensions:$lifecycle_version"
          implementation "androidx.lifecycle:lifecycle-livedata:$lifecycle_version"
          implementation "androidx.lifecycle:lifecycle-common-java8:$lifecycle_version"
          implementation 'android.arch.lifecycle:extensions:1.1.1'
          // optional - ReactiveStreams support for LiveData
          implementation "androidx.lifecycle:lifecycle-reactivestreams:$lifecycle_version"
          // For Kotlin use lifecycle-reactivestreams-ktx
          // optional - Test helpers for LiveData
          testImplementation "androidx.arch.core:core-testing:$lifecycle_version"
      }
      configurations {
          all*.exclude group: 'com.google.guava', module: 'listenablefuture'
      }
  
  }
  apply plugin: 'com.google.gms.google-services'
  apply plugin: 'io.fabric'
  
  </code></pre>
  
  <p>about this error <code>No original dex files found for dex location</code> I tried the solution in this <a href="https://stackoverflow.com/questions/42897739/java-io-ioexception-no-original-dex-files-found-for-dex-location">question1</a>, <a href="https://stackoverflow.com/questions/52269042/no-original-dex-files-found-for-dex-location">question2</a> but not working</p>