tinycreative / react-native-intercom

React Native wrapper for Intercom.io
MIT License
405 stars 279 forks source link

Could not find com.android.tools.build:gradle:3.6.1 #360

Closed Arxcis closed 4 years ago

Arxcis commented 4 years ago

React-native-intercom version

14.1.0

Description

Hi. I am using react-native-intercom in my project. When running gradlewbuild, react-native-intercom is trying to fetch gradle version 3.6.1 from jcenter url https://jcenter.bintray.com/com/android/tools/build/gradle/3.6.1/gradle-3.6.1.pom This URL does not lead anywhere. image

Raw Output with gradle 6.3

$ ./gradlew --version

------------------------------------------------------------
Gradle 6.3
------------------------------------------------------------

Build time:   2020-03-24 19:52:07 UTC
Revision:     bacd40b727b0130eeac8855ae3f9fd9a0b207c60

Kotlin:       1.3.70
Groovy:       2.5.10
Ant:          Apache Ant(TM) version 1.10.7 compiled on September 1 2019
JVM:          1.8.0_212-release (JetBrains s.r.o 25.212-b4-5784211)
OS:           Linux 5.3.0-7642-generic amd64

$ ./gradlew build

// .... 

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':react-native-intercom'.
> Could not resolve all artifacts for configuration ':react-native-intercom:classpath'.
   > Could not find com.android.tools.build:gradle:3.6.1.
     Searched in the following locations:
       - https://jcenter.bintray.com/com/android/tools/build/gradle/3.6.1/gradle-3.6.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-intercom

Raw output with gradle 5.6.4

$ ./gradlew --version

------------------------------------------------------------
Gradle 5.6.4
------------------------------------------------------------

Build time:   2019-11-01 20:42:00 UTC
Revision:     dd870424f9bd8e195d614dc14bb140f43c22da98

Kotlin:       1.3.41
Groovy:       2.5.4
Ant:          Apache Ant(TM) version 1.9.14 compiled on March 12 2019
JVM:          1.8.0_212-release (JetBrains s.r.o 25.212-b4-5784211)
OS:           Linux 5.3.0-7642-generic amd64

$ ./gradlew build

// .... 

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':react-native-intercom'.
> Could not resolve all artifacts for configuration ':react-native-intercom:classpath'.
   > Could not find com.android.tools.build:gradle:3.6.1.
     Searched in the following locations:
       - https://jcenter.bintray.com/com/android/tools/build/gradle/3.6.1/gradle-3.6.1.pom
       - https://jcenter.bintray.com/com/android/tools/build/gradle/3.6.1/gradle-3.6.1.jar
     Required by:
         project :react-native-intercom

build.gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    ext {
        buildToolsVersion = "28.0.3"
        minSdkVersion = 21
        compileSdkVersion = 28
        targetSdkVersion = 28
    }
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath('com.android.tools.build:gradle:3.6.3')
        classpath 'com.google.gms:google-services:4.3.3'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

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 {
            // Android JSC is installed from npm
            url("$rootDir/../node_modules/jsc-android/dist")
        }

        maven {
            "https://maven.google.com"
        }

        google()
        jcenter()

        maven { url 'https://jitpack.io' }
    }
}

Is it my fault?

Arxcis commented 4 years ago

I think I fixed this by downgrading to react-native-intercom v13.2

jfbn commented 3 years ago

I am experiencing the same issue now. I have been developing on this project for months on my laptop. Today I wanted to run it on my home pc, and the error "Could not find com.android.tools.build:gradle:3.6.3." persists.

I am using react-native-intercom v. 18.

I believe that it has something to do with my local Gradle and Java setup but I cannot pin point the culprit. Any help would be appreciated.

chiefchief commented 3 years ago

Same now

A problem occurred configuring project ':react-native-intercom'.
> Could not resolve all artifacts for configuration ':react-native-intercom:classpath'.
   > Could not find com.android.tools.build:gradle:4.1.2.
     Searched in the following locations:
       - https://jcenter.bintray.com/com/android/tools/build/gradle/4.1.2/gradle-4.1.2.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-intercom
"react-native-intercom": "13.2.0",

any solution?