使用MaterialDrawer库生成错误 [英] Build error using MaterialDrawer Library
问题描述
我正在尝试 MaterialDrawer库,但是在安装过程中遇到了构建错误.有没有人使用过这个库,并且知道是什么引起了这个问题?我已经在他们的github页面上打开了一个问题,但是由于Stackoverflow有数百万的程序员,我想知道你们中的任何人以前是否使用过这个库,并且知道如何解决这个问题?
I am trying this MaterialDrawer library But I am encountering a build error during setup. Has anyone used this library and knows what could be causing this issue? I already opened an issue on their github page but since Stackoverflow has millions of programmers I am wondering if any of you have used this library before and knows how to resolve this?
这只有一个依赖项
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
}
}
推荐答案
MaterialDrawer 使用支持库 v23.1.1 ,这些支持库需要使用compileSdkVersion 23
构建
The MaterialDrawer uses the support libraries v23.1.1 those require to be built with the compileSdkVersion 23
将您的gradle更新为:
Update your gradle to:
compileSdkVersion 23
buildToolsVersion '23.0.2'
,并将使用的支持库更新为
and also update the used support library to
compile 'com.android.support:support-v4:23.1.1'
如果由于某种原因而无法执行此操作. (您肯定总是应该选择使用最新的支持库),您可以从MaterialDrawer
中排除支持库,但是我认为这样做会造成许多奇怪的问题.甚至MaterialDrawer
的v1.0.0都使用了支持库v21.x
If you can't do this for some reason. (You definitely always should choose to use the latest support libraries) you may exclude the support libraries from the MaterialDrawer
, but I excpect this to create many strange issues. Even v1.0.0 of the MaterialDrawer
used the support libs v21.x
这篇关于使用MaterialDrawer库生成错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!