【发布时间】:2018-05-30 10:00:08
【问题描述】:
我在 Android Studio 2.3.3 上创建了一个项目并添加了 pdf 查看器,如下所示:
compile 'com.github.barteksc:android-pdf-viewer:2.0.3'
我可以无错误地构建项目,并且可以显示 pdf 文件。
现在我正在尝试将此库添加到我在 Android Studio 3.0.1 上创建的新项目中,如下所示,Gradle 项目同步失败。
implementation 'com.github.barteksc:android-pdf-viewer:2.0.3'
我收到此错误;
错误:无法解析 ':app@debug/compileClasspath' 的依赖关系: 无法解析 com.github.barteksc:android-pdf-viewer:2.0.3。
我的 gradle.build;
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "test.com.pdfviewer"
minSdkVersion 21
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
implementation 'com.github.barteksc:android-pdf-viewer:2.0.3'
}
【问题讨论】:
标签: android android-studio pdf pdf-viewer