在 android 个工作室项目中从 github 导入库时出现问题
Problems with importing libraries from github in android studio projects
我在 android 工作室项目中尝试从 github 导入库时遇到问题。成功导入的库很少。这是我在 android studio 项目中导入的方法:
从 github 下载 zip。
提取相应的库。
在 android studio 项目中导入模块,然后导入库并添加依赖项。
这是我在尝试导入 material 抽屉库时遇到的错误,抽屉库的 link 是:https://github.com/mikepenz/MaterialDrawer
Error:No such property: GROUP for class: org.gradle.api.publication.maven.internal.ant.DefaultGroovyMavenDeployer
我从 github 导入库的方法是否正确?
这是我的模块gradle。
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "com.works.vipul.materialdrawer"
minSdkVersion 15
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.0'
compile('com.mikepenz:materialdrawer:3.1.2@aar') {
transitive = true
}
}
您应该通过 gradle 解决 materialdrawer 依赖关系。
将这些添加到您的 build.gradle 存储库下
repositories {
mavenCentral() //add this line
}
也将其添加到您的 dependencies
下
compile('com.mikepenz:materialdrawer:3.1.2@aar') {
transitive = true
}
我在 android 工作室项目中尝试从 github 导入库时遇到问题。成功导入的库很少。这是我在 android studio 项目中导入的方法:
从 github 下载 zip。
提取相应的库。
在 android studio 项目中导入模块,然后导入库并添加依赖项。
这是我在尝试导入 material 抽屉库时遇到的错误,抽屉库的 link 是:https://github.com/mikepenz/MaterialDrawer
Error:No such property: GROUP for class: org.gradle.api.publication.maven.internal.ant.DefaultGroovyMavenDeployer
我从 github 导入库的方法是否正确?
这是我的模块gradle。
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "com.works.vipul.materialdrawer"
minSdkVersion 15
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.0'
compile('com.mikepenz:materialdrawer:3.1.2@aar') {
transitive = true
}
}
您应该通过 gradle 解决 materialdrawer 依赖关系。
将这些添加到您的 build.gradle 存储库下
repositories {
mavenCentral() //add this line
}
也将其添加到您的 dependencies
下compile('com.mikepenz:materialdrawer:3.1.2@aar') {
transitive = true
}