Android Studio代码检查似乎找不到任何项目特定的资源。
例如,我的styles.xml文件。
<resources>
<style name="AppBaseTheme" parent="Holo.Theme.Light.DarkActionBar">
</style>
<!-- Application theme. -->
<style name="AppTheme" parent="AppBaseTheme">
</style>
</resources>
标记第二个AppBaseTheme为红色并显示:"无法解析符号'AppBaseTheme'"。
应用程序可以编译和运行,但是我在资源上没有任何代码完成。检查似乎发现了ActionBarSherlock资源和HoloEverywhere资源(例如Holo.Theme.Light.DarkActionBar,自动完成也可以),但是。
应用程序(子)项目的build.gradle
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.4.1'
}
}
apply plugin: 'android'
dependencies {
//compile files('libs/android-support-v4.jar')
compile project(':abs-library')
compile project(':he-library')
compile project(':he-addons:slider')
compile project(':he-addons:preferences')
// using a custom repo here
compile 'com.google.android:support-v4:r13'
}
android {
compileSdkVersion 17
buildToolsVersion "17.0.0"
defaultConfig {
minSdkVersion 7
targetSdkVersion 17
}
sourceSets {
main {
manifest.srcFile 'src/main/AndroidManifest.xml'
java.srcDirs = ['src/main/java']
// abs-res, he-res are symlinks to ../abs-library/res
// and ../he-library/res
res.srcDirs = ['src/main/res', 'abs-res', 'he-res']
}
}
}