Skip to content

Fix Android build after JCenter sunset #12

Description

@craiganderson-iotv

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions