我正在尝试这个MaterialDrawer库,但在安装过程中遇到了一个构建错误。有没有人使用过这个库,知道是什么导致了这个问题?我已经在他们的github页面上打开了一个问题,但是由于Stackoverflow有数以百万计的程序员,我想知道你们中是否有人曾经使用过这个库,并且知道如何解决这个问题?
这只有一个依赖项。
compile('com.mikepenz:materialdrawer:4.5.1@aar') {
transitive = true
}以下是错误:
C:\Dev\AndroidWorkspace\NotBoringActionBar-master\App\build\intermediates\exploded-aar\com.android.support\appcompat-v7\23.1.1\res\values-ldltr-v21\values-ldltr-v21.xml
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Spinner.Underlined'.
C:\Dev\AndroidWorkspace\NotBoringActionBar-master\App\build\intermediates\exploded-aar\com.android.support\appcompat-v7\23.1.1\res\values-ldrtl-v23\values-ldrtl-v23.xml
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Spinner.Underlined'.
C:\Dev\AndroidWorkspace\NotBoringActionBar-master\App\build\intermediates\exploded-aar\com.mikepenz\materialize\0.5.1\res\values-v21\values-v21.xml
Error:(9, 21) No resource found that matches the given name: attr 'android:statusBarColor'.
Error:(8, 21) No resource found that matches the given name: attr 'android:windowDrawsSystemBarBackgrounds'.更新构建分级
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.0'
}
}
apply plugin: 'android'
repositories {
mavenCentral()
}
android {
compileSdkVersion 19
buildToolsVersion '19.1.0'
defaultConfig {
minSdkVersion 14
targetSdkVersion 19
}
buildTypes {
release {
// runProguard true
// proguardFile getDefaultProguardFile('proguard-android-optimize.txt')
}
}
productFlavors {
defaultFlavor {
proguardFile 'proguard-rules.txt'
}
}
}
dependencies {
compile 'com.android.support:support-v4:19.1.0'
compile('com.mikepenz:materialdrawer:4.5.1@aar') {
transitive = true
}
}发布于 2016-02-15 22:52:41
MaterialDrawer使用需要用compileSdkVersion 23构建的支持库v23.1.1
将您的等级更新为:
compileSdkVersion 23
buildToolsVersion '23.0.2'并将已使用的支持库更新为
compile 'com.android.support:support-v4:23.1.1'如果你因为某种原因不能这么做。(您肯定总是应该选择使用最新的支持库),您可以将支持库排除在MaterialDrawer之外,但我特别强调这一点,以创建许多奇怪的问题。甚至MaterialDrawer的v1.0.0都使用了支持库v21.x
https://stackoverflow.com/questions/33937207
复制相似问题