React-native-contacts: Could not find method google() for arguments [] on repository

Created on 14 Dec 2018  路  4Comments  路  Source: morenoh149/react-native-contacts

  • What went wrong:
    A problem occurred evaluating project ':react-native-contacts'.
    > Could not find method google() for arguments [] on repository container of type org.gradle.api.internal.artifacts.dsl.DefaultRepositoryHandler.

Please help to resolve the issue.

Most helpful comment

i resolve the issue
update the gradle to 4.5
by going andorid/gradle/wrapper/gradle-wrapper.properties
to distributionUrl=https\://services.gradle.org/distributions/gradle-4.5-all.zip
then react-native run-android
enjoy

All 4 comments

not sure

@krishna201 add google() to .//android/build.gradle

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

buildscript {
    repositories {
        google()
        jcenter()
        gradlePluginPortal()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'

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

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

Same issue here.

i resolve the issue
update the gradle to 4.5
by going andorid/gradle/wrapper/gradle-wrapper.properties
to distributionUrl=https\://services.gradle.org/distributions/gradle-4.5-all.zip
then react-native run-android
enjoy

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fabriziomoscon picture fabriziomoscon  路  8Comments

suryaiiit picture suryaiiit  路  5Comments

uriva picture uriva  路  6Comments

msutyak picture msutyak  路  9Comments

dubbelnisse picture dubbelnisse  路  10Comments