【发布时间】:2018-05-04 11:32:09
【问题描述】:
我正在尝试在我的项目中使用这个库。但是我无法通过将其添加到 gradle build 中来下载它。事实上,我什至无法通过 gradle 下载任何库。我需要手动下载一个 jar 文件并将其添加为库。但在这种情况下,我找不到 PDFviewer 的 jar 文件。
Build.gradle(模块)
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.1.1'
compile 'com.android.support:design:23.0.1'
testCompile 'junit:junit:4.12'
compile files('libs/jsoup-1.8.1.jar')
compile files('libs/log4j-1.2.9.jar')
compile files('libs/picasso-2.5.2.jar')
compile files('libs/json-simple-1.1.jar')
compile files('libs/glide-3.7.0.jar')
compile files('libs/commons-codec-1.9.jar')
compile files('libs/asmack.jar')
compile files('libs/android-logging-log4j-1.0.3.jar')
compile 'com.github.barteksc:android-pdf-viewer:2.8.1' //unable to add this.
}
Build.gradle
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
// google()
// mavenLocal() // tried everything
}
}
在过去的三天里,我几乎尝试了 SO 中给出的所有方法,但仍然找不到任何解决方案。即使我得到 jar 文件也会很有帮助。
【问题讨论】:
-
你能提供日志吗?
-
顺便说一下
compile fileTree(include: ['*.jar'], dir: 'libs')已经编译库中的所有JAR文件 -
但我无法获得这个特定的库。 @cricket_007
-
我知道。只需指出
compile files('libs/*.jar')是不必要的 -
嘿@IntelliJAmiya,您的回答有效。我只是犯了一个偶然的错误。像这样匆忙粘贴`maven { maven { url "jcenter.bintray.com" } }`非常感谢!
标签: android android-gradle-plugin build.gradle pdf-viewer