从今天开始,Android Studio在styles.xml中找不到AppCompat主题,但代码中的AppCompatActivity可以被识别出来。我的Android Studio版本是2.2.2,Build #AI-145.3360264。
我已经尝试升级到最新的构建工具、编译sdk(25)版本等,但这并没有解决问题。
目前,我已经安装了以下内容(从sdk管理器中):
- android API:19和23
- sdk平台工具:25.0.1
- sdk工具:25.2.3
- build-tools:23.0.2和25.0.1
- support repository:40
- google repository:39
还有其他一些内容,不必在此列出。
app的build.gradle:
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'
}
appcompat-v7
并在重新添加之前进行同步有所帮助。让我们一起点赞并期待在 issuetracker.google.com/issues/67790757 上的更新。 - sunadorer