我在android studio中构建gradle时遇到错误。
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion '23.0.2'
defaultConfig {
applicationId "com.whyz.kitetech.mobile.cdrapp"
minSdkVersion 18
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
repositories {
mavenCentral()
// maven { url 'http://repo1.maven.org/maven2' }
// maven { url "http://owasp-java-html-sanitizer.googlecode.com/svn/maven" }
//maven { url 'https://oss.sonatype.org/content/repositories/ksoap2-android-releases/' }
}
buildTypes {
debug {
debuggable = true
}
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile 'junit:junit:4.12'
compile 'com.android.support:cardview-v7:23.0.1'
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:design:23.0.1'
compile 'com.android.support:recyclerview-v7:23.0.1'
// NOTE: vector-compat is available on API level 14 or later
compile 'com.wnafee:vector-compat:1.0.5'
compile 'de.codecrafters.tableview:tableview:0.9.5'
compile 'com.diogobernardino:williamchart:2.0.1'
}
答案 0 :(得分:0)
首先,你必须将存储库块移出android块。
apply plugin: 'com.android.library'
android {
}
repositories {
mavenCentral()
// maven { url 'http://repo1.maven.org/maven2' }
// maven { url "http://owasp-java-html-sanitizer.googlecode.com/svn/maven" }
// maven { url 'https://oss.sonatype.org/content/repositories/ksoap2-android-releases/' }
}
然后您的问题是中央Maven或Jcenter上不存在de.codecrafters.tableview
。
作为解决方法,您可以将github repo与jitpack plugin
一起使用这很简单。
只需将此代表添加到您的build.gradle
repositories {
// ...
maven { url "https://jitpack.io" }
}
和依赖:
dependencies {
compile 'com.github.User:Repo:Tag'
}
在你的情况下似乎是:
compile 'com.github.ISchwarz23:SortableTableView:v0.9.5'