I have an android project that has been running for more than 7 years now. Today I updated the SDK to 34 (from 33) because Google is requiring me to. After doing so, my gradle build started to fail consistently. I won't include the whole log (unless needed) but here's the errors that I get:
Required by:
project :app
> Could not resolve io.github.zncmn.libyuv:core:0.0.7.
> Could not get resource 'https://jitpack.io/io/github/zncmn/libyuv/core/0.0.7/core-0.0.7.pom'.
> Could not GET 'https://jitpack.io/io/github/zncmn/libyuv/core/0.0.7/core-0.0.7.pom'. Received status code 401 from server: Unauthorized
> Could not resolve io.github.zncmn.libyuv:core:0.0.7.
> Could not get resource 'https://jitpack.io/io/github/zncmn/libyuv/core/0.0.7/core-0.0.7.pom'.
> Could not GET 'https://jitpack.io/io/github/zncmn/libyuv/core/0.0.7/core-0.0.7.pom'. Received status code 401 from server: Unauthorized
> Could not find com.amulyakhare:com.amulyakhare.textdrawable:1.0.1.
Searched in the following locations:
- https://jcenter.bintray.com/com/amulyakhare/com.amulyakhare.textdrawable/1.0.1/com.amulyakhare.textdrawable-1.0.1.pom
- https://jitpack.io/com/amulyakhare/com.amulyakhare.textdrawable/1.0.1/com.amulyakhare.textdrawable-1.0.1.pom
- https://maven.google.com/com/amulyakhare/com.amulyakhare.textdrawable/1.0.1/com.amulyakhare.textdrawable-1.0.1.pom
- https://dl.google.com/dl/android/maven2/com/amulyakhare/com.amulyakhare.textdrawable/1.0.1/com.amulyakhare.textdrawable-1.0.1.pom
- file:/home/runner/.m2/repository/com/amulyakhare/com.amulyakhare.textdrawable/1.0.1/com.amulyakhare.textdrawable-1.0.1.pom
- https://repo.maven.apache.org/maven2/com/amulyakhare/com.amulyakhare.textdrawable/1.0.1/com.amulyakhare.textdrawable-1.0.1.pom
Required by:
project :app
> Could not find com.github.gcacace:signature-pad:1.2.1.
Searched in the following locations:
- https://jcenter.bintray.com/com/github/gcacace/signature-pad/1.2.1/signature-pad-1.2.1.pom
- https://jitpack.io/com/github/gcacace/signature-pad/1.2.1/signature-pad-1.2.1.pom
- https://maven.google.com/com/github/gcacace/signature-pad/1.2.1/signature-pad-1.2.1.pom
- https://dl.google.com/dl/android/maven2/com/github/gcacace/signature-pad/1.2.1/signature-pad-1.2.1.pom
- file:/home/runner/.m2/repository/com/github/gcacace/signature-pad/1.2.1/signature-pad-1.2.1.pom
- https://repo.maven.apache.org/maven2/com/github/gcacace/signature-pad/1.2.1/signature-pad-1.2.1.pom
Required by:
project :app
> Could not find com.mikhaellopez:circularimageview:3.2.0.
Searched in the following locations:
- https://jcenter.bintray.com/com/mikhaellopez/circularimageview/3.2.0/circularimageview-3.2.0.pom
- https://jitpack.io/com/mikhaellopez/circularimageview/3.2.0/circularimageview-3.2.0.pom
- https://maven.google.com/com/mikhaellopez/circularimageview/3.2.0/circularimageview-3.2.0.pom
- https://dl.google.com/dl/android/maven2/com/mikhaellopez/circularimageview/3.2.0/circularimageview-3.2.0.pom
- file:/home/runner/.m2/repository/com/mikhaellopez/circularimageview/3.2.0/circularimageview-3.2.0.pom
- https://repo.maven.apache.org/maven2/com/mikhaellopez/circularimageview/3.2.0/circularimageview-3.2.0.pom
Required by:
project :app
It continues like this for some of the libraries used in my project and then ultimately fails.
I did not change anything else except the targetSdkVersion to 34 instead of 33. My build.gradle looks like this:
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:8.5.2'
classpath 'com.google.gms:google-services:4.3.14'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.5.2'
}
}
allprojects {
repositories {
jcenter()
maven { url "https://jitpack.io" }
maven {
url 'https://maven.google.com/'
}
// flatDir {
// dirs "$rootProject.projectDir/aars"
// }
}
}
Something interesting to note: I can generate an APK/Bundle locally without any issue. The issue lies in my github pipeline that generate the Bundle for me.
Anyone has any idea how I could solve this? I ran into a few posts asking this specific question but there was no answer unfortunately.
These dependencies won't be found because JCenter has been sunset i.e. it's no longer available, even in read-only mode
So adding jcenter()
in your build.gradle file has no effect
All of the dependencies, mentioned above, are hosted on JCenter/Bintray, and haven't been migrated to the other sources
You can do one of the following
gradle showMeCache
build.gradle
file, declare that as a local dependency (aar/jar) fileimplementation "your_local_dependency.aar"
or create a libs
folder and put all your dependencies under that, and help gradle locate it
// Include local .jar and .aar files under the libs/ folder
implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar", "*.aar"))))
You can create a fork of the mentioned library and host on Maven Central, using the following guide
Migrate or integrate other libraries that are maintained and do the same thing as what you require