我試圖導入library from github我遇到的問題,同時導入庫到Android項目
我下載ZIP解壓縮和我it.Then進口圖書館;圖書館的gradle似乎有很多錯誤需要修復。
apply plugin: 'com.android.library'
apply plugin: 'maven'
apply plugin: 'signing'
android {
compileSdkVersion Integer.parseInt(project.TARGET_SDK_VERSION)
buildToolsVersion "22.0.1"
defaultConfig {
minSdkVersion MIN_SDK_VERSION
targetSdkVersion project.TARGET_SDK_VERSION
versionCode Integer.parseInt(project.VERSION_CODE)
versionName project.VERSION_NAME
}
buildTypes {
release {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
minifyEnabled false
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
}
signing {
required { has("release") && gradle.taskGraph.hasTask("uploadArchives") }
sign configurations.archives
}
uploadArchives {
configuration = configurations.archives
repositories.mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
repository(url: sonatypeRepo) {
authentication(userName: sonatypeUsername, password: sonatypePassword)
}
snapshotRepository(url: snapshotRepo) {
authentication(userName: sonatypeUsername, password: sonatypePassword)
}
pom.project {
name POM_NAME
description POM_DESC
packaging 'aar'
url POM_URL
scm {
url POM_SCM_URL
connection POM_SCM_CONN
developerConnection POM_SCM_DEV_CONN
}
licenses {
license {
name LICENCE_NAME
url LICENCE_URL
distribution 'repo'
}
}
developers {
developer {
id POM_DEV
name POM_DEV_NAME
}
}
}
}
}
我已經取代了SDK_VERSION
與我的項目的版本,但仍存在不少誤區&我不知道如何解決這些問題。
使用Gradle編譯,不要使用JAR。 –