Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio "can't resolove symbol 'Theme'"

I'm using android studio 0.8.4 when I extend @style/Theme.AppCompat.Light, android studio says can't resolove symbol 'Theme' with red font colored Theme. but when I run this project, it runs well. I can't know how to solve this problem. belows are my codes.

styles.xml

<resources>
    <!-- the theme applied to the application or activity -->
    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
    </style>
</resources>

build.gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 20
    buildToolsVersion "20.0.0"

    defaultConfig {
        applicationId "kr.co.hiworks.office"
        minSdkVersion 9
        targetSdkVersion 19
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    lintOptions {
        disable 'InvalidPackage'
    }

    packagingOptions {
        exclude 'META-INF/services/javax.annotation.processing.Processor'
    }

}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:support-v4:19.+'
    compile 'com.android.support:appcompat-v7:19.+'
    compile 'com.jakewharton:butterknife:5.1.1'
    compile 'com.nineoldandroids:library:2.4.0'
    compile 'com.mcxiaoke.volley:library:1.0.6'
    compile 'com.github.satyan:sugar:1.3'
}

AndroidManifest.xml

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

    <application
        android:name=".BaseApplication"
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <meta-data android:name="DATABASE" android:value="hiworks_office.db" />
        <meta-data android:name="VERSION" android:value="1" />
        <meta-data android:name="QUERY_LOG" android:value="true" />
        <meta-data android:name="DOMAIN_PACKAGE_NAME" android:value="kr.hiworks.office.models" />
        <activity
            android:name=".activities.MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
</manifest>
like image 209
Cinakyn Avatar asked Aug 04 '14 09:08

Cinakyn


1 Answers

https://code.google.com/p/android/issues/detail?id=64649

This bug is because of gradle 0.12.2 So I changed gradle version from 0.12.+ to 0.12.1 and It works well.

like image 147
Cinakyn Avatar answered Oct 14 '22 21:10

Cinakyn