我尝试将我的 android 项目从 Maven 迁移到 Gradle,然后出现此错误:
Gradle:找不到与给定名称匹配的资源:attr 'mdActiveIndicator'。
感谢您帮助寻找解决方案。
这是我的项目结构:
MediaProject
build.gradle (%1)
settings.gradle (%2)
HoloCircleSeekBar
build.gradle (%3)
src/main/res/values
attrs.xml (%4)
MediaAppli
telecommande
build.gradle (%5)
src/main/res/values
styles.xml (%6)
MediaProject 中 build.gradle 的内容 (%1)
allprojects {
repositories {
mavenCentral()
}
}
MediaProject 中 settings.gradle 的内容 (%2)
include ':HoloCircleSeekBar',':MediaAppli:telecommande'
HoloCircleSeekBar 中 build.gradle 的内容 (%3)
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.4'
}
}
apply plugin: 'android-library'
dependencies {
compile files('libs/android-support-v4.jar')
}
android {
compileSdkVersion 17
buildToolsVersion "17.0.0"
defaultConfig {
minSdkVersion 7
targetSdkVersion 16
}
}
Telemande 中 attrs.xml 的内容 (%4)
<resources>
<attr name="menuDrawerStyle" format="reference" />
<declare-styleable name="MenuDrawer">
<attr name="mdMenuSize" format="dimension" />
<attr name="mdActiveIndicator" format="reference" />
</declare-styleable>
</resources>
Telemande 中 build.gradle 的内容 (%5)
buildscript {
repositories {
mavenCentral()
maven {
url "http://repo1.maven.org/maven2"
}
}
dependencies {
classpath 'com.android.tools.build:gradle:0.4'
}
}
apply plugin: 'android'
dependencies {
compile files('libs/android-support-v4.jar')
compile project(':HoloCircleSeekBar')
}
android {
compileSdkVersion 17
buildToolsVersion "17.0.0"
defaultConfig {
minSdkVersion 7
targetSdkVersion 16
}
}
远程控制中 styles.xml 的内容 (%6)
<style name="MenuDrawerStyle.Right" parent="MenuDrawer.Widget">
<item name="mdActiveIndicator">@drawable/menu_arrow_right</item>
<item name="mdMenuSize">150dp</item>
</style>