thebylito / react-native-navigation-bar-color

React Native component to change bottom bar/navigation bar color on Android
MIT License
269 stars 49 forks source link

Gradle dependencies issues #46

Open kg-currenxie opened 3 years ago

kg-currenxie commented 3 years ago

My build.gradle file.

buildscript {
    ext {
        buildToolsVersion = "28.0.3"
        supportLibVersion = "28.0.3"
        minSdkVersion = 18
        compileSdkVersion = 29
        targetSdkVersion = 29
        kotlinVersion = '1.3.10'
    }
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath("com.android.tools.build:gradle:3.5.2")
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
    }
}

allprojects {
    repositories {
        mavenLocal()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url("$rootDir/../node_modules/react-native/android")
        }
        maven {
            // Detox
            url("$rootDir/../node_modules/detox/Detox-android")
        }
        maven {
            // Android JSC is installed from npm
            url("$rootDir/../node_modules/jsc-android/dist")
        }
        google()
        jcenter()
        maven {
            url 'https://jitpack.io'
        }
    }
}

After installing the package, building the app fails:

* What went wrong:
A problem occurred configuring project ':react-native-navigation-bar-color'.
> Could not resolve all artifacts for configuration ':react-native-navigation-bar-color:classpath'.
   > Could not resolve com.android.tools.lint:lint:24.3.1.
     Required by:
         project :react-native-navigation-bar-color > com.android.tools.build:gradle:1.3.1 > com.android.tools.build:gradle-core:1.3.1
      > Could not resolve com.android.tools.lint:lint:24.3.1.
         > Could not get resource 'https://jcenter.bintray.com/com/android/tools/lint/lint/24.3.1/lint-24.3.1.pom'.
            > Could not GET 'https://jcenter.bintray.com/com/android/tools/lint/lint/24.3.1/lint-24.3.1.pom'.
               > peer not authenticated

Seems your com.android.tools.build:gradle is very outdated?

kg-currenxie commented 3 years ago

Works for me:

diff --git a/node_modules/react-native-navigation-bar-color/android/build.gradle b/node_modules/react-native-navigation-bar-color/android/build.gradle
index 24026a4..84f021f 100644
--- a/node_modules/react-native-navigation-bar-color/android/build.gradle
+++ b/node_modules/react-native-navigation-bar-color/android/build.gradle
@@ -1,10 +1,11 @@
 buildscript {
     repositories {
         jcenter()
+        google()
     }

     dependencies {
-        classpath 'com.android.tools.build:gradle:1.3.1'
+        classpath 'com.android.tools.build:gradle:3.5.2'
     }
 }

changed by using https://github.com/ds300/patch-package