Yaron
Yaron

Reputation: 173

Android Studio 1.5.1 rendering problems

I'm new to android studio and I have a new version installed (version 1.5.1). For some reason I keep getting an error message (every time I use an app theme) saying that there were rendering problems: styles missing. I looked online for solutions, but most of them are outdated or just do not work.

An image of the error

Thanks for any help.

Manifest file:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.easycodingplus.myapplication">

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity
            android:name=".MainActivity"
            android:label="@string/app_name"
            android:theme="@style/AppTheme.NoActionBar">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>

Build gradle:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

    defaultConfig {
        applicationId "com.easycodingplus.myapplication"
        minSdkVersion 8
        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.1.1'
    compile 'com.android.support:design:23.1.1'
}

Upvotes: 6

Views: 4583

Answers (7)

adila adelle
adila adelle

Reputation: 1

I also faced the same problem so what I did...go to sdk manager -->tick android 5.1.1 api level 22 and installed it.... tick android 5.1.1 api level 22 and installed it.. then go to Preview window and select other version

then go to Preview window and select other version

Upvotes: 0

Dhawal Shukal
Dhawal Shukal

Reputation: 13

3 options

1.Select low-level API version

I have 23 but you can go for 19 or 21

2.Add Base on styles.xml

select theme from AppTheme or dealer here

3.Install previous SDK (if you want)

Upvotes: 0

NCS
NCS

Reputation: 1

I faced the same problem and these steps helped me solve it: 1. File > Other settings > Default Settings > Appearances & Behaviour > File encoding. 2. Change project encoding to windows-1252. Then: 3. File > Invalidate Chaches/Restart. OR WORST CASE Change the theme to Material light or something else, one of them should work. I hope this helps.

Upvotes: -1

mehrdad khosravi
mehrdad khosravi

Reputation: 2258

try this way:

keep your internet connection

go to "file" in android studio toolbar click on "invalidate caches/Restart" and choose "invalidate and restart"

Upvotes: 0

Ajay P. Prajapati
Ajay P. Prajapati

Reputation: 2023

just change your style.xml file like this

<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
    <!-- Customize your theme here. -->
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>
</style>

and then, go to

File > Project Structure > app >

and set (both should be same with latest version )

source compatibility : 1.7

Target compatibility : 1.7

Upvotes: 4

tccpg288
tccpg288

Reputation: 3352

Please ensure you have the lateset AppCompat library listed as a dependency in your build.gradle file:

com.android.support:appcompat-v7:23.1.0

Can you post which style the error is referring to? You may need to add a style to your res > values > styles folder. Something in your code is probably referencing a style that does not exists in that folder.

Upvotes: 0

Pankaj Nimgade
Pankaj Nimgade

Reputation: 4549

you have to include the dependencies for design which is like this, this will be added under the dependencies block of the app module of the build.gradle

compile 'com.android.support:design:23.1.1'

it should be something like this ..

you need this support library as CoordinatorLayout, AppBarLayout and FloatingActionButton part of it

enter image description here

make a style in the style file

<style name="AppTheme" parent="Base.Theme.AppCompat.Light">
    <!-- Customize your theme here. -->
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>
    <item name="windowActionBar">false</item>
    <item name="windowNoTitle">true</item>
</style>

and reference that in your AndroidManifest file

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:largeHeap="true"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">// like this

Upvotes: 0

Related Questions