gpt4 book ai didi

Android Studio "can' t 解析符号 'Theme'"

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:39:41 24 4
gpt4 key购买 nike

我正在使用 android studio 0.8.4当我扩展 @style/Theme.AppCompat.Light 时,android studio 说 can't resolove symbol 'Theme' with red font colored Theme。但是当我运行这个项目时,它运行良好。我不知道如何解决这个问题。下面是我的代码。

样式.xml

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

构建.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>

最佳答案

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

这个bug是因为gradle 0.12.2所以我将 gradle 版本从 0.12.+ 更改为 0.12.1 并且运行良好。

关于Android Studio "can' t 解析符号 'Theme'",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25115970/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com