DImuthuUpe / AndroidPdfViewer

Android view for displaying PDFs rendered with PdfiumAndroid
Apache License 2.0
8.17k stars 1.91k forks source link

Failed to resolve: com.github.barteksc:android-pdf-viewer:3.2.0-beta.1 #1153

Open fullstact69 opened 1 year ago

fullstact69 commented 1 year ago

Android Studio Flamingo | 2022.2.1 Patch 2.

Anyone to resolve this?

afaneca commented 1 year ago

JCenter seems to be down (maybe permanently). You need to get this dependency from another repository. Try jitpack.

mhnowak commented 1 year ago

I have the same issue on CI. We're using jitpack and it doesn't help. Any thoughts?

image
afaneca commented 1 year ago

Seems to be related with this issue.

ron-brosh commented 1 year ago

Seems like some tags are not present: https://github.com/barteksc/AndroidPdfViewer/tags

I have a dependency on a library that uses com.github.barteksc:android-pdf-viewer:2.8.2 Can't see 2.8.2 tag though..

Harsh5488 commented 1 year ago

Add the following code in the "settings.gradle" file

maven { url "https://jcenter.bintray.com"}
image


Now add this code in the "gradle.properties" file

android.enableJetifier=true
image
Now rebuild the project after cleaning it. This may help resolving the issue.

dhirunand commented 9 months ago

Add this line at two place in build.gradle maven { url "https://jcenter.bintray.com"}/

example,

// Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { // ext.kotlin_version = '1.7.1' repositories { google() mavenCentral() maven { url "https://jcenter.bintray.com"}/ } dependencies { classpath 'com.android.tools.build:gradle:8.1.2' classpath 'com.google.gms:google-services:4.4.0' classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.9'

// classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files

// def nav_version = '2.7.6' classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.7.6"

} }

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

maven { url "https://jitpack.io" } //zooming photoView

} }

tasks.register('clean', Delete) { delete rootProject.buildDir }

sikrinick commented 3 months ago

I use next solution.

Add it to your project level build.gradle.kts.

allprojects {
    configurations {
        all {
            resolutionStrategy {
                dependencySubstitution {
                    substitute(module("com.github.barteksc:android-pdf-viewer"))
                        .using(module("com.github.DImuthuUpe:AndroidPdfViewer:3.2.0-beta.1"))
                        .because("Library is in a process of ownership transfer. Jitpack and Jcenter are not reliable.")
                }
            }
        }
    }
}
3l500nfy commented 3 months ago

Heres a solution in 2024, worked for me in your build.gradle.kts

implementation("com.github.mhiew:android-pdf-viewer:3.2.0-beta.1") ,

and in your settings.gradle.kts :

dependencyResolutionManagement { repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) repositories { google() mavenCentral() maven(url = "https://jitpack.io") // Notice the syntax for url jcenter() // Deprecated, consider removing or replacing if possible } }.

GoodLuck bandicam 2024-08-22 12-36-17-951 bandicam 2024-08-22 12-35-58-111

Nayan014 commented 3 months ago

After trying numerous solutions, this one finally worked for me. Link

RaghavStepron commented 2 months ago

(Aug 2024) Add these two in your Project level build.gradle

 buildscript {
  ext {
    .
    ..
    pdfViewerVersion = '3.2.0-beta.3'
    pdfViewerRepo = 'com.github.mhiew'
  }

and in settings.gradle

dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
    .
    ..
    mavenCentral()
    }
  }
}
omandotkom commented 2 months ago

(Aug 2024) Add these two in your Project level build.gradle

 buildscript {
  ext {
    .
    ..
    pdfViewerVersion = '3.2.0-beta.3'
    pdfViewerRepo = 'com.github.mhiew'
  }

and in settings.gradle

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

thank you!!!

RiotGoesWoof commented 2 months ago

(Aug 2024) Add these two in your Project level build.gradle

 buildscript {
  ext {
    .
    ..
    pdfViewerVersion = '3.2.0-beta.3'
    pdfViewerRepo = 'com.github.mhiew'
  }

and in settings.gradle

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

This is the answer. JCenter is deprecated. Do not try to use it.

meng7171 commented 1 month ago

Heres a solution in 2024, worked for me in your build.gradle.kts

implementation("com.github.mhiew:android-pdf-viewer:3.2.0-beta.1") ,

and in your settings.gradle.kts :

dependencyResolutionManagement { repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) repositories { google() mavenCentral() maven(url = "https://jitpack.io") // Notice the syntax for url jcenter() // Deprecated, consider removing or replacing if possible } }.

GoodLuck bandicam 2024-08-22 12-36-17-951 bandicam 2024-08-22 12-35-58-111

v-mas commented 1 month ago

as this is the same repo as original barteksc - just renamed, it could be nice to have 3.2.0-beta-1 tag, as currently there isn't one, but it used to be. This way some of us could at least stay in the "core repository" for the project and would not be forced to downgrade.