我想设置一个导航抽屉Neokree https://github.com/neokree/MaterialNavigationDrawer对Android Studio没有成功。Neokree导航抽屉:未找到Gradle DSL方法:'compile()'
加入这个我gradle这个后 - >的build.gradle文件
repositories {
mavenCentral()
}
dependencies {
compile 'it.neokree:MaterialNavigationDrawer:1.3.3'
}
然后我得到这个错误说 “摇篮工程同步失败”,这下面
错误:(27,0)未找到Gradle DSL方法:'compile()'
可能的原因:项目“MaterialNavigationDrawer”可能使用的Gradle版本不包含该方法。
Gradle设置构建文件可能缺少Gradle插件。
应用Gradle插件。
这是我的文件夹的gradle - >的build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.0.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}
}
repositories {
mavenCentral()
}
dependencies {
compile 'it.neokree:MaterialNavigationDrawer:1.3.3'
}
我知道我做错了什么是肯定的,我似乎无法弄清楚。
而不是使用第三方库的导航抽屉,你可以使用androids自己的设计库中提供的导航抽屉作为参考检查此链接http://android-developers.blogspot.in/2015/05/android-design- support-library.html –
感谢您的建议,androids自己的导航抽屉其实更好。 –