0

I just started a project with my Android Studio. I suddenly started to have problems with layout preview. Preview renders the screen normally but I get an annoying Rendering Problems window that says:

Rendering Problems The following classes could not be found:
- android.support.v7.internal.app.WindowDecorActionBar (Fix Build Path, Create Class)
Tip: Try to build the project.

Of course, I tried many things.

  • build the project
  • clean and rebuild the project
  • clean, rebuild, sync and then rebuild again
  • cleaning app data before doing any of the above
  • uninstalled and reinstalled the android studio and then repeated the above steps.

Any idea what the problem might be?

My build.gradle is:

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.0.0-alpha1'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

apply plugin: 'com.android.application'

android {
    signingConfigs {
    }
    compileSdkVersion 23
    buildToolsVersion "23.0.1"
    defaultConfig {
        applicationId "gr.asd.asdapp"
        minSdkVersion 16
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    dexOptions {
        jumboMode = true
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:support-v4:23.1.1'
    compile 'com.android.support:appcompat-v7:23.1.1'
    compile 'com.android.support:design:23.1.1'
}
TheCrafter
  • 1,909
  • 2
  • 23
  • 44

1 Answers1

0

As suggested here

Rendering Problems The following classes could not be found: android.support.v7.internal.app.WindowDecorActionBar

Change your theme to inherit from a Base Theme.

<style name="AppTheme" parent="Theme.AppCompat.Mpla.Mpla">
<!-- Customize your theme here. -->
</style>

with

<style name="AppTheme" parent="Base.Theme.AppCompat.Mpla.Mpla">
<!-- Customize your theme here. -->
</style>

Android Studio has a terrible out-of-the-box experience. But it used to be worse. A completely new project that was not using the latest API would yield Obsolete class errors and you had to replace Activity with AppCompatActivity to make it work

Having said that, if you target the latest API your problem will be gone but obviously that's not a solution :)

Community
  • 1
  • 1