0

I have just updated to Android Studio version 3, however it I am unable to see my layouts in the preview window as each element is just a grey box like this: Blank layout

The error in the Issues window says

Exception Details java.lang.ClassNotFoundException: android.support.v4.view.TintableBackgroundView

along with several other classes that are unable to be found

and here are the relevant parts of the build.gradle for my app:

apply plugin: 'com.android.application'
apply plugin: 'me.tatarka.retrolambda'
apply plugin: 'kotlin-android'

android {
    compileSdkVersion 23
    buildToolsVersion '25.0.3'

    defaultConfig {
        applicationId "com.myapp.app"
        minSdkVersion 16
        targetSdkVersion 23
        versionCode 123
        versionName "1.2.3"
        vectorDrawables.useSupportLibrary = true
    }


    dexOptions {
        javaMaxHeapSize "6g"
    }

    packagingOptions {
        exclude 'META-INF/rxjava.properties'
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

repositories {
    mavenCentral()
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])

compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"


compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
compile 'com.google.android.gms:play-services-appindexing:8.3.0'
compile 'com.google.android.gms:play-services-gcm:8.3.0'
compile 'com.android.support:recyclerview-v7:23.4.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:customtabs:23.4.0'
compile 'com.android.support:support-v4:23.4.0'
testCompile 'junit:junit:4.12'




testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.1'
debugCompile 'com.facebook.stetho:stetho:1.5.0'
debugCompile 'com.facebook.stetho:stetho-urlconnection:1.5.0'
debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5.1'
releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.1'

debugCompile "com.github.brianPlummer:tinydancer:0.1.2"
releaseCompile "com.github.brianPlummer:tinydancer-noop:0.1.2"
testCompile "com.github.brianPlummer:tinydancer-noop:0.1.2"

}

apply plugin: 'com.google.gms.google-services'

2 Answers2

1

I was having same problem. I made a small changing in Styles.xml file, now it's back to normal.

<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">

this line to;

<style name="AppTheme" parent="Base.Theme.AppCompat.Light.DarkActionBar">

It works but I don't know any details...

hamdicatal
  • 11
  • 2
0

You have to add compatibility library by right clicking your project and selecting Android Tools -> Add Compatibility Library. Once its added, clean your project and build again.


enter image description here

Nawrez
  • 3,314
  • 8
  • 28
  • 42
  • Hi, as you can see in the gradle file I have already included the support library, and also the screenshot you provided doesn't seem to match with what I see on android studio – Piers Walter Oct 27 '17 at 08:20