Fix Android build after JCenter sunset
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 55/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- android, java, react-native
- Domain
- build-system, mobile
Research direction
Start with android/build.gradle and reproduce the Android build failure caused by the jcenter() repository declarations. Replace the repository configuration as shown in the issue, then run the Android build to confirm the library builds successfully without JCenter.
Written by the indexing model from the issue text.
Description
I have used patch-package to patch react-native-screen-corner-radius@0.2.3 for the project I'm working on.
Unfortunately, after the sunset of JCenter, the library doesn't build for Android:
FAILURE: Build failed with an exception.
* Where:
Build file '<redacted>/node_modules/react-native-screen-corner-radius/android/build.gradle' line: 7
* What went wrong:
A problem occurred evaluating project ':react-native-screen-corner-radius'.
> Could not find method jcenter() for arguments [] on repository container of type org.gradle.api.internal.artifacts.dsl.DefaultRepositoryHandler.
Here is the diff that solved my problem, using this solution:
diff --git a/node_modules/react-native-screen-corner-radius/android/build.gradle b/node_modules/react-native-screen-corner-radius/android/build.gradle
index 48d7647..3178796 100644
--- a/node_modules/react-native-screen-corner-radius/android/build.gradle
+++ b/node_modules/react-native-screen-corner-radius/android/build.gradle
@@ -4,7 +4,8 @@ buildscript {
repositories {
google()
- jcenter()
+ mavenCentral()
+ maven { url 'https://jitpack.io' }
}
dependencies {
@@ -52,7 +53,7 @@ android {
repositories {
mavenCentral()
- jcenter()
+ maven { url 'https://jitpack.io' }
google()
def found = false
This issue body was partially generated by patch-package.
- Dominant language
- Java
- Stars
- 121
- Forks
- 11
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from mrousavy/react-native-screen-corner-radius
-
ScreenCornerRadius crashes at import on iOS simulator: "Cannot read property 'cornerRadius' of null" Open
Difficulty 1/5 Under an hour Newbie friendliness 74/100
mrousavy/react-native-screen-corner-radius#15 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
mrousavy/react-native-screen-corner-radius#10 · 2 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
mrousavy/react-native-screen-corner-radius#4 · 1 reaction ·
All issues in mrousavy/react-native-screen-corner-radius
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
bug needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 1/5 Under an hour Newbie friendliness 94/100
objectionary/hone-maven-plugin#1061 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
spring-projects/spring-modulith#1895 ·