3

Hello developers friends!

I am studying development for Android in recent months.

But just this last week came the question . How can I solve the problem of the image below ?

Android - Rendering Error

L. D. James
  • 1,679
  • 1
  • 22
  • 35
  • Can you include the text of build.gradle file with above question – Shishupal Shakya Nov 20 '15 at 18:02
  • Welcome to SO. Please include the error text as a code block in your answer (indented by four spaces). If the image is deleted someday, your question will no longer be understandable. Also it would be really helpful to see the code that produced this error. Cheers :) – m00am Nov 20 '15 at 18:05
  • I had the same issue and found one of the possible solutions [here](http://stackoverflow.com/questions/33742114/rendering-problems-the-following-classes-could-not-be-found-android-support-v7) – Borislav Borisov Nov 20 '15 at 19:51

2 Answers2

15

ActionBar is deprecated in the latest android api... If you need to use it make sure your theme read as follow:

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

you can find this in:

res > values > styles.xml
Junior Mayhé
  • 16,144
  • 26
  • 115
  • 161
Karue Benson Karue
  • 957
  • 12
  • 26
  • 1
    I would like to add, my styles file had Theme.AppCompat.Light.DarkActionBar and I was still experiencing this issue. It quickly went away when I changed it to Base.Theme.AppCompat.Light.DarkActionBar. – estebro Dec 22 '15 at 03:31
  • This also solved my problem. But I dont understand why adding the "Base." prefix fixed it. Care to explain? :) – redgetan Feb 08 '16 at 01:44
0

I was also getting these errors.

Solved by setting similar versions to the fields in gradle file as below

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.0"

    defaultConfig {
        applicationId "com.intplus.hijackid"
        minSdkVersion 16
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.0.0'
}

Observe the versions compileSdkVersion, buildToolsVersion, targetSdkVersion also the support v7 version.

I was having appcompat-v7:21.0.3. Changes as shown above fixed the issues!

Shree Harsha S
  • 665
  • 7
  • 14