A problem occurred configuring project ':react-native-settings'. when use in (react-native: 0.70.4)
"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
yarn add react-native-settings@^0.2.3
Same, any solution?
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'
}
}
any solution in react native 71?
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
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.
Hi all 👋 I'd be happy to accept a PR for this and ship a new version is this is working for people
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
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
So? any other solution ? its not working for me
Still working for me with react native 0.70.9
v1.0.2 fixed both things (minsdk & maven) mentioned in this thread.
For a little soap box talk - no one gave a PR to fix 2 lines of code for years. Granted no one has also responded in years so maybe I'm only one of a few left on this package.
We have to work together for open source packages - all it takes it one person to do a PR and its a few button clicks away from a release and fix.