我在使用 com.github.barteksc:android-pdf-viewer 包时遇到问题 - 它无法通过 JitPack、Maven Central、Gradle 或任何其他存储库解决。还有办法使用这个库吗?我读到版本 3.2.0-beta.1 可能可以工作,但我无法使用。
构建.gradle
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
id "io.sentry.android.gradle" version "4.14.1"
}
android {
bundle {
language {
// Specifies that the app bundle should not support
// configuration APKs for language resources. These
// resources are instead packaged with each base and
// dynamic feature APK.
enableSplit = false
}
}
compileSdk 34
defaultConfig {
applicationId "es.clickrent.digitizationcontracts"
minSdk 26
targetSdk 34
versionCode 29
versionName '3.3.0'
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
shrinkResources false
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
buildFeatures {
viewBinding true
}
namespace 'es.clickrent.digitizationcontracts'
}
dependencies {
implementation 'androidx.core:core-ktx:1.8.0'
implementation 'androidx.appcompat:appcompat:1.4.2'
implementation 'com.google.android.material:material:1.6.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.5.1'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1'
implementation 'androidx.navigation:navigation-fragment-ktx:2.5.1'
implementation 'androidx.navigation:navigation-ui-ktx:2.5.1'
implementation 'androidx.preference:preference:1.2.0'
implementation 'androidx.preference:preference-ktx:1.2.0'
implementation 'androidx.webkit:webkit:1.4.0'
implementation 'androidx.annotation:annotation:1.4.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.android.play:asset-delivery:2.2.2'
implementation 'com.google.android.play:app-update:2.1.0'
implementation 'com.beardedhen:androidbootstrap:2.3.2'
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.9.0'
implementation 'com.squareup.retrofit2:converter-jackson:2.9.0'
implementation 'com.pranavpandey.android:dynamic-toasts:4.1.0'
implementation 'com.github.Kaopiz:KProgressHUD:1.0'
implementation 'com.github.f0ris.sweetalert:library:1.6.2'
implementation 'com.github.barteksc:android-pdf-viewer:3.2.0-beta.1'
implementation 'com.github.gcacace:signature-pad:1.3.1'
implementation 'com.github.anastr:speedviewlib:1.5.5'
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.mockito:mockito-core:5.3.1'
testImplementation 'org.mockito:mockito-inline:3.8.0'
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
testImplementation "androidx.arch.core:core-testing:2.2.0"
}
设置.gradle
pluginManagement {
repositories {
gradlePluginPortal()
google()
mavenCentral()
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
jcenter()
gradlePluginPortal()
maven { url 'https://jitpack.io' }
maven { url 'https://maven.google.com' }
}
}
rootProject.name = "Clickrent App Mobile Digitization Contracts"
include ':app'
谢谢!
旧存储库已经很长时间没有更新了,我建议您使用已移至 androidx 的替代方案(您不必使用 Jetifier)。这个问题已经在这里深入讨论过。