Skip to content

Commit fcb3701

Browse files
committed
fix: build.gradle
1 parent dca006f commit fcb3701

1 file changed

Lines changed: 36 additions & 12 deletions

File tree

‎android/build.gradle‎

Lines changed: 36 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -54,22 +54,16 @@ project.ext {
5454

5555
allprojects {
5656
repositories {
57-
all { repo ->
58-
println repo.url.toString()
59-
if (repo.url.toString().contains("jcenter.bintray.com") || repo.url.toString().contains("jitpack.io")) {
60-
project.logger.warn "Repository ${repo.url} removed."
61-
remove repo
62-
google()
63-
mavenCentral()
64-
}
65-
}
66-
6757
google()
58+
mavenCentral()
59+
6860
maven {
6961
url "https://maven.fabric.io/public"
7062
}
71-
maven { url "https://www.jitpack.io" }
72-
maven { url "https://packages.rnd.mendix.com/jcenter" }
63+
64+
maven {
65+
url "https://packages.rnd.mendix.com/jcenter"
66+
}
7367

7468
// Build all modules with Android 16KB pages enabled
7569
plugins.withId('com.android.application') {
@@ -98,4 +92,34 @@ allprojects {
9892
}
9993
}
10094

95+
// Clean up phase: remove auto-added repositories and re-add JitPack correctly
96+
afterEvaluate { project ->
97+
def jitpackRemoved = false
98+
99+
project.repositories.removeAll { repo ->
100+
def repoUrl = repo.url.toString()
101+
102+
// Remove deprecated JCenter
103+
if (repoUrl.contains("jcenter.bintray.com")) {
104+
return true
105+
}
106+
107+
// Remove auto-added JitPack (re-added below)
108+
if (repoUrl.contains("jitpack.io")) {
109+
jitpackRemoved = true
110+
return true
111+
}
112+
113+
return false
114+
}
115+
116+
if (jitpackRemoved) {
117+
project.repositories {
118+
maven {
119+
url "https://www.jitpack.io"
120+
}
121+
}
122+
}
123+
124+
}
101125
apply plugin: "com.facebook.react.rootproject"

0 commit comments

Comments
 (0)