Rak*_*olo 4 android pdf-viewer build.gradle android-gradle-plugin
我正在尝试在我的项目中使用这个库。但我无法通过将其添加到 gradle build 来下载它。事实上,我什至无法通过 gradle 下载任何库。我需要手动下载 jar 文件并将其添加为库。但在这种情况下,我找不到 PDFviewer 的 jar 文件。
构建.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.
}
Run Code Online (Sandbox Code Playgroud)
构建.gradle
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
// google()
// mavenLocal() // tried everything
}
}
Run Code Online (Sandbox Code Playgroud)
在过去的三天里,我几乎尝试了SO中给出的所有内容,但仍然找不到任何解决方案。即使我得到 jar 文件也会有帮助。
小智 21
只需将此行添加到build.gradle(app level)
implementation 'com.github.barteksc:android-pdf-viewer:2.8.2'
Run Code Online (Sandbox Code Playgroud)
如果你有android studio bumblebee或android studio Arctic Fox那么,
将gradlePluginPortal()添加到settings.gradle文件中
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}
Run Code Online (Sandbox Code Playgroud)
你应该添加
repositories
{
maven { url "http://jcenter.bintray.com" }
}
Run Code Online (Sandbox Code Playgroud)
小智 5
当他掉落时,这是 jCenter(已弃用)的问题。
添加 :
allprojects {repositories {
mavenCentral()
google()
gradlePluginPortal()
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
16149 次 |
| 最近记录: |