Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A problem occurred configuring project ':react-native-settings'. when use in (react-native: 0.70.4) #120

Open
nisharafic001 opened this issue Nov 6, 2022 · 11 comments

Comments

@nisharafic001
Copy link

"react-native-settings": "^1.0.0",
"react-native": "0.70.4",

when I install this package above mentioned version following error occurred. could you help.

FAILURE: Build failed with an exception.

  • What went wrong:
    A problem occurred configuring project ':react-native-settings'.

Could not determine the dependencies of null.
Could not resolve all task dependencies for configuration ':react-native-settings:classpath'.
> Could not find com.android.tools.build:gradle:1.3.1.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/1.3.1/gradle-1.3.1.pom
If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
Required by:
project :react-native-settings

@nisharafic001 nisharafic001 changed the title A problem occurred configuring project ':react-native-settings'. A problem occurred configuring project ':react-native-settings'. when use in (react-native: 0.70.4) Nov 6, 2022
@nurassyl
Copy link

yarn add react-native-settings@^0.2.3

@ahmettopal
Copy link

Same, any solution?

@FelixKLabs
Copy link

FelixKLabs commented Jan 27, 2023

add the maven central repository in build.gradlle file in the buildscript section,
google repository does not have the 1.3.1 version (it starts with 3,x,x as you can see here)
https://mvnrepository.com/artifact/com.android.tools.build/gradle?repo=google
maven central has the older versions,
alternatively I think you can increment to gradle 3.1.1.
to make the code permanent in your RN app you can use the patch-package library
https://github.com/ds300/patch-package#readme

buildscript {
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.3.1'
    }
}

@peyman-hakemi
Copy link

any solution in react native 71?

@prog-24
Copy link

prog-24 commented Mar 12, 2023

I have a solution using patches. Here it is.

diff --git a/node_modules/react-native-settings/android/build.gradle b/node_modules/react-native-settings/android/build.gradle
index 6f8e7d0..9c98885 100644
--- a/node_modules/react-native-settings/android/build.gradle
+++ b/node_modules/react-native-settings/android/build.gradle
@@ -1,14 +1,17 @@
 buildscript {
     repositories {
         google()
+        jcenter()
     }
     dependencies {
-        classpath 'com.android.tools.build:gradle:1.3.1'
+        classpath "com.android.tools.build:gradle:3.4.1"
     }
 }
 
 apply plugin: 'com.android.library'
 
+apply plugin: 'com.android.library'
+
 def projectVar(name, fallback) {
     return project.findProperty(name) ?: fallback
 }
@@ -18,7 +21,7 @@ android {
     buildToolsVersion projectVar('buildToolsVersion', '23.0.1')
 
     defaultConfig {
-        minSdkVersion 16
+        minSdkVersion projectVar('minSdkVersion', 16)
         targetSdkVersion projectVar('targetSdkVersion', 22)
         versionCode 1
         versionName "1.0"
@@ -29,7 +32,8 @@ android {
 }
 
 repositories {
-    mavenCentral()
+    google()
+    jcenter()
 }
 
 dependencies {

Essentially, add jcenter() and google() to the repositories and bump the gradle version

@azuken
Copy link

azuken commented Mar 13, 2023

I have a solution using patches. Here it is.

diff --git a/node_modules/react-native-settings/android/build.gradle b/node_modules/react-native-settings/android/build.gradle
index 6f8e7d0..9c98885 100644
--- a/node_modules/react-native-settings/android/build.gradle
+++ b/node_modules/react-native-settings/android/build.gradle
@@ -1,14 +1,17 @@
 buildscript {
     repositories {
         google()
+        jcenter()
     }
     dependencies {
-        classpath 'com.android.tools.build:gradle:1.3.1'
+        classpath "com.android.tools.build:gradle:3.4.1"
     }
 }
 
 apply plugin: 'com.android.library'
 
+apply plugin: 'com.android.library'
+
 def projectVar(name, fallback) {
     return project.findProperty(name) ?: fallback
 }
@@ -18,7 +21,7 @@ android {
     buildToolsVersion projectVar('buildToolsVersion', '23.0.1')
 
     defaultConfig {
-        minSdkVersion 16
+        minSdkVersion projectVar('minSdkVersion', 16)
         targetSdkVersion projectVar('targetSdkVersion', 22)
         versionCode 1
         versionName "1.0"
@@ -29,7 +32,8 @@ android {
 }
 
 repositories {
-    mavenCentral()
+    google()
+    jcenter()
 }
 
 dependencies {

Essentially, add jcenter() and google() to the repositories and bump the gradle version

This is a workaround, not a solution. Maintainers should upgrade this project dependencies.

@erezrokah
Copy link
Member

Hi all 👋 I'd be happy to accept a PR for this and ship a new version is this is working for people

@prog-24
Copy link

prog-24 commented Mar 13, 2023

Hi all 👋 I'd be happy to accept a PR for this and ship a new version is this is working for people

Happy to open a PR

@prog-24
Copy link

prog-24 commented Mar 13, 2023

I have a solution using patches. Here it is.

diff --git a/node_modules/react-native-settings/android/build.gradle b/node_modules/react-native-settings/android/build.gradle
index 6f8e7d0..9c98885 100644
--- a/node_modules/react-native-settings/android/build.gradle
+++ b/node_modules/react-native-settings/android/build.gradle
@@ -1,14 +1,17 @@
 buildscript {
     repositories {
         google()
+        jcenter()
     }
     dependencies {
-        classpath 'com.android.tools.build:gradle:1.3.1'
+        classpath "com.android.tools.build:gradle:3.4.1"
     }
 }
 
 apply plugin: 'com.android.library'
 
+apply plugin: 'com.android.library'
+
 def projectVar(name, fallback) {
     return project.findProperty(name) ?: fallback
 }
@@ -18,7 +21,7 @@ android {
     buildToolsVersion projectVar('buildToolsVersion', '23.0.1')
 
     defaultConfig {
-        minSdkVersion 16
+        minSdkVersion projectVar('minSdkVersion', 16)
         targetSdkVersion projectVar('targetSdkVersion', 22)
         versionCode 1
         versionName "1.0"
@@ -29,7 +32,8 @@ android {
 }
 
 repositories {
-    mavenCentral()
+    google()
+    jcenter()
 }
 
 dependencies {

Essentially, add jcenter() and google() to the repositories and bump the gradle version

This is a workaround, not a solution. Maintainers should upgrade this project dependencies.

Semantics :D

@YasarKantarcilar
Copy link

So? any other solution ? its not working for me

@x7Michi10x
Copy link

Still working for me with react native 0.70.9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants