未能解决:com.github.barteksc:android pdf查看器:3.2.0-beta.1如何修复此问题



我尝试构建android pdf阅读器并添加一个库com.github.barteksc:android pdf查看器:2.8.2然后它显示以下错误

我的build.gradle文件是请大家帮我解决这个问题,我想构建尽可能多的应用程序

请大家帮我

plugins {
id 'com.android.application'
}
android {
compileSdk 32
defaultConfig {
applicationId "com.dash.songuploader"
minSdk 21
targetSdk 32
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildToolsVersion '32.0.0'
}
dependencies {
implementation 'com.karumi:dexter:6.2.3'
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.5.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
implementation 'com.squareup.retrofit2:converter-scalars:2.9.0'
//    implementation 'com.squareup.picasso:picasso:2.71828'
//pdf library
implementation 'com.github.barteksc:android-pdf-viewer:2.8.2'
//dbshbs
implementation 'com.github.barteksc:android-pdf-viewer:3.2.0-beta.1'
//    implementation 'com.joanzapata.pdfview:android-pdfview:2.8.2@aar'
}

上面的许多评论都谈到了将jcenter((添加到settings.gradle.

这对我来说不起作用。为了让我的Flutter项目再次运行,我不得不将jcenter((添加到android/build.gradle文件中。

allprojects {
repositories {
google()
mavenCentral()
jcenter()
}
}

将jcenter((添加到settings.gradle

implementation 'com.github.mhiew:android-pdf-viewer:3.2.0-beta.1'

在android工作室中,我只是用mavenCentral((替换jcenter((,并用它替换依赖关系。

用于参考的图像

dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
jcenter()
}
}

将jcenter((添加到settings.gradle

对于flutter项目,使用flutter_pdfview包。尝试在maven repo的顶部添加jcenter((来构建.gradle文件

allprojects {
repositories {
google()
jcenter()
mavenCentral()
maven { url "https://jitpack.io" }
}
}

在android Studio中,在grade.setting中的以下位置添加jcenter((有助于我在android Studio 中

dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
jcenter()
}

对于这个版本的2.8.2,它只在jCenter上可用,但如果你对jCenter有问题,你可以使用其他选项,比如jitpack

maven { url 'https://jitpack.io' }
implementation 'com.github.barteksc:AndroidPdfViewer:master-SNAPSHOT'

添加maven { url 'https://jitpack.io' }到settings.gradle(项目设置(。

像这样:

dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven { url 'https://jitpack.io' }
}

}

相关内容

最新更新