Richou / react-native-android-location-enabler

Display a GoogleMap like android popup to ask for user to enable location services if disabled
MIT License
209 stars 52 forks source link

Could not find method google() for arguments [] on repository container. #14

Closed lucas-dolsan closed 6 years ago

lucas-dolsan commented 6 years ago

Finished installing it, react-native run-android outputed the following error:

* Where:
Build file '...\node_modules\react-native-android-location-enabler\android\build.gradle' line: 5

* What went wrong:
A problem occurred evaluating project ':react-native-android-location-enabler'.
> Could not find method google() for arguments [] on repository container.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 15.523 secs
{
react-native-cli: 2.0.1
react-native: 0.53.0
}
Richou commented 6 years ago

Did you add google() repo in your android/build.gradle ?

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

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

allprojects {
    repositories {
        mavenLocal()
        jcenter()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url "$rootDir/../node_modules/react-native/android"
        }
        google()
    }
}
lucas-dolsan commented 6 years ago

I didn't, then I followed this thread react-native-community/react-native-svg/issues/584 which suggests the same thing you said. Apparently I have to update my projects gradle wrapper, unfortunately this causes conflicts with a few other installed packages.