mkuczera / react-native-haptic-feedback

React-Native Haptic Feedback for iOS with Android similar behaviour.
MIT License
879 stars 109 forks source link

Jcenter shut down causes problems on the module #68

Closed gromanas closed 3 years ago

gromanas commented 3 years ago

Today we have started to see this issue :

':react-native-haptic-feedback'.
> Could not resolve all artifacts for configuration ':react-native-haptic-feedback:classpath'.
   > Could not resolve com.android.tools.build:builder:3.0.0.
     Required by:
         project :react-native-haptic-feedback > com.android.tools.build:gradle:3.0.0 > com.android.tools.build:gradle-core:3.0.0
      > Could not resolve com.android.tools.build:builder:3.0.0.
         > Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/builder/3.0.0/builder-3.0.0.pom'.
            > Could not HEAD 'https://jcenter.bintray.com/com/android/tools/build/builder/3.0.0/builder-3.0.0.pom'.
               > Read timed out
   > Could not resolve org.eclipse.jdt.core.compiler:ecj:4.6.1.
     Required by:
         project :react-native-haptic-feedback > com.android.tools.build:gradle:3.0.0 > com.android.tools.build:gradle-core:3.0.0 > com.android.tools.lint:lint:26.0.0
      > Skipped due to earlier error
   > Could not resolve com.google.code.gson:gson:2.3.
     Required by:
         project :react-native-haptic-feedback > com.android.tools.build:gradle:3.0.0 > com.android.tools.build:gradle-core:3.0.0 > com.android.tools.lint:lint:26.0.0 > com.android.tools.build:manifest-merger:26.0.0
         project :react-native-haptic-feedback > com.android.tools.build:gradle:3.0.0 > com.android.tools.build:gradle-core:3.0.0 > com.android.tools.lint:lint:26.0.0 > com.android.tools.build:manifest-merger:26.0.0 > com.android.tools:sdklib:26.0.0
      > Skipped due to earlier error
   > Could not resolve com.google.errorprone:error_prone_annotations:2.0.18.
     Required by:
         project :react-native-haptic-feedback > com.android.tools.build:gradle:3.0.0 > com.android.tools.build:gradle-core:3.0.0 > com.android.tools.build:gradle-api:3.0.0 > com.google.guava:guava:22.0
      > Skipped due to earlier error
   > Could not resolve org.jetbrains.kotlin:kotlin-reflect:1.1.3-2.
     Required by:
         project :react-native-haptic-feedback > com.android.tools.build:gradle:3.0.0 > com.android.tools.build:gradle-core:3.0.0 > com.android.tools.lint:lint:26.0.0 > com.android.tools.lint:lint-checks:26.0.0 > com.android.tools.lint:lint-api:26.0.0
      > Skipped due to earlier error

Is there any workaround on this? Thank you in advance!

Fetten commented 3 years ago

I stumbled upon this issue as well lately. It seems like this line is causing the error.

Replacing jcenter() with mavenCentral() worked for me locally.

-- Update: @remoblaser already created a PR #67

remoblaser commented 3 years ago

Currently the only way is either using this or waiting for jcenter to come online again. However, jcenter will be shut down by February 2022 anyways so it might be a good idea to replace it already.

gromanas commented 3 years ago

Thank you very much! I saw that you have already opened a PR. I have the same feeling with you to replace it already. Are you going to cut a new release to include the mavenCentral()?

remoblaser commented 3 years ago

I guess it's on the Organisation to merge this pull request. For now I've patched my app like this:

diff --git a/node_modules/react-native-haptic-feedback/android/build.gradle b/node_modules/react-native-haptic-feedback/android/build.gradle
index c326a26..198fb2a 100644
--- a/node_modules/react-native-haptic-feedback/android/build.gradle
+++ b/node_modules/react-native-haptic-feedback/android/build.gradle
@@ -4,7 +4,7 @@ def DEFAULT_TARGET_SDK_VERSION              = 27

 buildscript {
     repositories {
-        jcenter()
+        mavenCentral()
         google()
     }

using https://www.npmjs.com/package/patch-package

mkuczera commented 3 years ago

Resolved in v1.13.0 https://github.com/junina-de/react-native-haptic-feedback/releases/tag/v1.13.0