react-native-ssl-pinning icon indicating copy to clipboard operation
react-native-ssl-pinning copied to clipboard

Update the Gradle Build Version

Open stperona opened this issue 1 year ago • 7 comments

While attempting to build our project today we've began to experience the following error:

A problem occurred configuring project ':react-native-ssl-pinning'.
> Could not determine the dependencies of null.
   > Could not resolve all task dependencies for configuration ':react-native-ssl-pinning:classpath'.
      > Could not find com.android.tools.build:gradle:2.2.0.
        Searched in the following locations:
          - https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/2.2.0/gradle-2.2.0.pom
          - https://repo.maven.apache.org/maven2/com/android/tools/build/gradle/2.2.0/gradle-2.2.0.pom
          - https://jcenter.bintray.com/com/android/tools/build/gradle/2.2.0/gradle-2.2.0.pom
        Required by:
            project :react-native-ssl-pinning

It appears the library still depends on Gradle v2.2.0 which is seemingly no longer available in the repos. Is it possible to get a version bump on this dependency and a new release issued?

stperona avatar Jun 22 '23 17:06 stperona

+1. Facing the same issue. Please update the version to 2.3.0 which is now available in jcenter

dhinesh-elumalai avatar Jun 22 '23 19:06 dhinesh-elumalai

Facing same issue on react-native 0.70

m00nreal avatar Jun 23 '23 05:06 m00nreal

Facing the same issue any solution for that?

saravana-mitrah avatar Jun 23 '23 06:06 saravana-mitrah

facing the same issue with .71

JoNesVai avatar Jun 23 '23 08:06 JoNesVai

We fixed it with patch-package and just upgraded the version in the build.gradle

diff --git a/node_modules/react-native-ssl-pinning/android/build.gradle b/node_modules/react-native-ssl-pinning/android/build.gradle
index efb23b8..2fa38bd 100644
--- a/node_modules/react-native-ssl-pinning/android/build.gradle
+++ b/node_modules/react-native-ssl-pinning/android/build.gradle
@@ -5,7 +5,7 @@ buildscript {
     }
 
     dependencies {
-        classpath 'com.android.tools.build:gradle:2.2.0'
+        classpath 'com.android.tools.build:gradle:2.3.0'
     }
 }
 

akucharczyk avatar Jun 23 '23 08:06 akucharczyk

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':tasks'.
> Could not create task ':react-native-ssl-pinning:compileDebugJavaWithJavac'.
   > In order to compile Java 9+ source, please set compileSdkVersion to 30 or above

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.

TEMPORARY SOLUTION: change react-native-ssl-pinning/build.gradle as following:

buildscript {
    repositories {
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.0'
    }
}

apply plugin: 'com.android.library'

android {
    compileSdkVersion 33
    buildToolsVersion "33.0.2"

    defaultConfig {
        minSdkVersion 16
        targetSdkVersion 33
        compileSdkVersion 33
        versionCode 1
        versionName "1.0"
    }
    lintOptions {
        abortOnError false
    }
}

repositories {
    mavenCentral()
}

dependencies {
   implementation "com.facebook.react:react-native:+"
    implementation "com.squareup.okhttp3:okhttp:4.9.0"
    implementation "com.squareup.okio:okio:2.6.0"
    implementation "com.github.franmontiel:PersistentCookieJar:v1.0.1"
    implementation "com.squareup.okhttp3:logging-interceptor:4.9.0"
    implementation "com.squareup.okhttp3:okhttp-urlconnection:4.9.0"
}

Unfortunately this changes removes every npm/yarn install. There is a need to release update for this library.

aykutuludag avatar Jul 20 '23 22:07 aykutuludag

facing the same issue

himanshi-coder avatar Sep 07 '24 12:09 himanshi-coder