无法解析styles.xml中的符号'Theme'(Android Studio) [英] Cannot resolve symbol 'Theme' in styles.xml (Android Studio)

查看:1068
本文介绍了无法解析styles.xml中的符号'Theme'(Android Studio)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



从今天开始,Android Studio无法在styles.xml中找到AppCompat主题,但例如代码中的AppCompatActivity确实得到了识别。我的Android Studio版本是2.2.2,Build#AI-145.3360264

我已经尝试升级到最新的编译工具,编译sdk(25)版本等,但它didn解决了这个问题。
$ b

目前我已经安装了以下内容(来自sdk manager):


  • android api:19和23

  • sdk平台工具:25.0.1
  • sdk工具:25.2.3
  • li>
  • build-tools:23.0.2和25.0.1
  • 支持存储库:40
  • google存储库:39



以及其他一些内容,这里不需要列出。



build.gradle of app:

  apply plugin:'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion '25 .0.1'
defaultConfig {
applicationIdxxx.xxxxxxxx.xxxxxxxxx// not the real applicationId
minSdkVersion 14
targetSdkVersion 19
版本代码1
versionName1.0
testInstrumentationRunnerandroid.support.test.runner.AndroidJUnitRunner
}
buildTypes {
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'),'proguard-rules.pro'
}
debug {

}


$ b编译fileTree(include:['* .jar'],dir:'libs')
编译文件('libs' /RootTools.jar')
编译'com.android.support:support-v4:23.+'
编译'com.android.support:support-v13:23.+'
编译'com.android.support:appcompat-v7:23.+'
编译'com.android.support:design:23.+'
编译'com.android.support:cardview-v7: 23. +'
compile'c​​om.android.support.constraint:constraint-layout:1.0.0-beta4'
compile'de.hdodenhof:circlei mageview:2.1.0'
}


解决方案

不需要改变任何东西。



只需按下顶部的小按钮使用Gradle文件同步项目


Since today, Android Studio can't find the AppCompat themes in styles.xml, but for example AppCompatActivity in code does get recognized. My Android Studio version is 2.2.2, Build #AI-145.3360264

I already tried upgrading to the latest build tools, compile sdk (25) version etc. but it didn't fix the problem.

At the moment I have installed the following (from sdk manager):

  • android api: 19 and 23
  • sdk platform tools: 25.0.1
  • sdk tools: 25.2.3
  • build-tools: 23.0.2 and 25.0.1
  • support repository: 40
  • google repository: 39

and a few others, that shouldn't be necessary to list here.

build.gradle of app:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion '25.0.1'
    defaultConfig {
        applicationId "xxx.xxxxxxxx.xxxxxxxxx" //not the real applicationId
        minSdkVersion 14
        targetSdkVersion 19
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled true
            shrinkResources true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
        debug {

        }
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile files('libs/RootTools.jar')
    compile 'com.android.support:support-v4:23.+'
    compile 'com.android.support:support-v13:23.+'
    compile 'com.android.support:appcompat-v7:23.+'
    compile 'com.android.support:design:23.+'
    compile 'com.android.support:cardview-v7:23.+'
    compile 'com.android.support.constraint:constraint-layout:1.0.0-beta4'
    compile 'de.hdodenhof:circleimageview:2.1.0'
}

解决方案

No need to change anything.

Just press small button on top "Sync Project with Gradle Files"

这篇关于无法解析styles.xml中的符号'Theme'(Android Studio)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆