【发布时间】:2015-08-04 14:57:36
【问题描述】:
我正在尝试在我的 Android 应用程序中使用 this Java 库。从文档中,我必须将 compile "json-to-pdf:json-to-pdf:0.7.5" 放在我的 build.grade 依赖项中。当我尝试同步项目时,出现错误:
错误:(39, 13) 解析失败:json-to-pdf:json-to-pdf:0.7.5
我asked the owner,但他不知道如何解决。我想我也必须在 build.grade 中添加以下 Maven 依赖项:
<repositories>
<repository>
<id>clojars.org</id>
<url>http://clojars.org/repo</url>
</repository>
</repositories>
但我不知道该怎么做。
这是我目前的设置:
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
compileOptions.encoding = 'ISO-8859-1'
defaultConfig {
applicationId "br.com.app"
minSdkVersion 14
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories {
jcenter()
//mavenCentral() I tried that but doesn't work
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.1'
...
compile 'json-to-pdf:json-to-pdf:0.7.5' // Doesn't work
}
【问题讨论】:
标签: maven android-studio gradle