React-native-contacts: Could not find com.android.tools:common:25.3.1.

Created on 9 Dec 2018  路  11Comments  路  Source: morenoh149/react-native-contacts

Old version of gradle has missing dependencies

Could not find com.android.tools:common:25.3.1.
Searched in the following locations:
    https://jcenter.bintray.com/com/android/tools/common/25.3.1/common-25.3.1.pom
    https://jcenter.bintray.com/com/android/tools/common/25.3.1/common-25.3.1.jar
Required by:
    project :react-native-contacts > com.android.tools.build:gradle:2.3.1 > com.android.tools.build:gradle-core:2.3.1 > com.android.tools.build:builder:2.3.1
    project :react-native-contacts > com.android.tools.build:gradle:2.3.1 > com.android.tools.build:gradle-core:2.3.1 > com.android.tools.build:builder:2.3.1 > com.android.tools.build:manifest-merger:25.3.1
    project :react-native-contacts > com.android.tools.build:gradle:2.3.1 > com.android.tools.build:gradle-core:2.3.1 > com.android.tools.build:builder:2.3.1 > com.android.tools.ddms:ddmlib:25.3.1
    project :react-native-contacts > com.android.tools.build:gradle:2.3.1 > com.android.tools.build:gradle-core:2.3.1 > com.android.tools.build:builder:2.3.1 > com.android.tools.analytics-library:shared:25.3.1
    project :react-native-contacts > com.android.tools.build:gradle:2.3.1 > com.android.tools.build:gradle-core:2.3.1 > com.android.tools.build:builder:2.3.1 > com.android.tools.analytics-library:tracker:25.3.1
    project :react-native-contacts > com.android.tools.build:gradle:2.3.1 > com.android.tools.build:gradle-core:2.3.1 > com.android.tools.build:builder:2.3.1 > com.android.tools:sdklib:25.3.1 > com.android.tools.layoutlib:layoutlib-api:25.3.1
    project :react-native-contacts > com.android.tools.build:gradle:2.3.1 > com.android.tools.build:gradle-core:2.3.1 > com.android.tools.build:builder:2.3.1 > com.android.tools:sdklib:25.3.1 > com.android.tools:dvlib:25.3.1
    project :react-native-contacts > com.android.tools.build:gradle:2.3.1 > com.android.tools.build:gradle-core:2.3.1 > com.android.tools.build:builder:2.3.1 > com.android.tools:sdklib:25.3.1 > com.android.tools:repository:25.3.1

Fix:

buildscript {
    repositories {
        google()
        jcenter()
    }

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

Most helpful comment

I encountered the same problem.
And this is my solution.
I added the following to the top build.gradle.

subprojects { subproject ->
    def name = subproject.name
    if (name.contains('react-native-contacts')) {
        buildscript {
            repositories {
                maven { url "https://dl.bintray.com/android/android-tools/"  }
            }
        }
    }
}

All 11 comments

@solonifer :- I encountered the same error and followed the steps mentioned above. But the error does not go away. The configuration that I am using is as follows:-

react-native-cli: 2.0.1
react-native: 0.47.0
"react": "16.0.0-alpha.12",
"react-dom": "16.0.0-alpha.12",

Request you to kindly help

Under dependencies, I have

classpath 'com.android.tools.build:gradle:3.2.1'

tried changing it to 3.1.4 as mentioned above , but no luck.

Any working solution?

I encountered the same problem.
And this is my solution.
I added the following to the top build.gradle.

subprojects { subproject ->
    def name = subproject.name
    if (name.contains('react-native-contacts')) {
        buildscript {
            repositories {
                maven { url "https://dl.bintray.com/android/android-tools/"  }
            }
        }
    }
}

@PersistentSatyenVelankar have you added google() to repositories?

@solonifer - Yes I have added google() to repositories

@PersistentSatyenVelankar have you changed this inside
node_modules/react-native-contacts/android/build.gradle ?
Not in your application. It should work.

You can also try to change buildToolsVersion in the same file.

@rt2zz do you have any plans to release the fix as a new version in npmjs soon?

@solonifer :- Hi , Thanks , but I think that means that everytime I reinstall node-modules , I need to apply this patch of code. I was looking for a solution where patching of code is not required

A PR for the fix would be merged. @PersistentSatyenVelankar @igorkurochka if someone wants to narrow down the fix to exactly the lines that need to change I'd appreciate it.

PR merged and 2.2.5 published on npm

Was this page helpful?
0 / 5 - 0 ratings

Related issues

narenderv7 picture narenderv7  路  5Comments

dualcyclone picture dualcyclone  路  6Comments

suryaiiit picture suryaiiit  路  5Comments

rafaumlemos picture rafaumlemos  路  4Comments

syedibrahimt picture syedibrahimt  路  4Comments