React-native-vector-icons: What went wrong: A problem occurred evaluating project ':react-native-vector-icons'.

Created on 16 Oct 2018  路  7Comments  路  Source: oblador/react-native-vector-icons

I did follow the instructions , Result = error :(
" React-native run-android"
" Scanning folders for symlinks in D:\React\Packingdemo\node_modules (40ms)
JS server already running.
Building and installing the app on the device (cd android && gradlew.bat installDebug)...

FAILURE: Build failed with an exception.

  • Where:
    Build file 'D:\React\Packingdemo\node_modules\react-native-vector-icons\android\build.gradle' line: 4

  • What went wrong:
    A problem occurred evaluating project ':react-native-vector-icons'.

    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: 6.008 secs
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/getting-started.html "

Most helpful comment

Hey guys, I've just met the same issue after installing this library. The default version in package.json is 6.0.2.

I've solved this problem by below changes:

  1. change configuration in android/build/gradle. This is part of my code:
buildscript {
    repositories {
        jcenter()
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.4'

        // 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()
    }
}

add google() to buildscript and allprojects, and change the gradle version in classpath. Open ...\node_modules\react-native-vector-icons\android\build.gradle, you will find the gradle version in classpath is 3.1.4, that's why we need to make this change.

  1. In your android project, open android/gradle/wrapper/gradle-wrapper.properties, modify the distributionUrl:
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip

Since this library depends on gradle version above 3.1.4, we should set a new version than that.

Rebuild the project, it finally works.

All 7 comments

Same error in emulator after install the react-native-vector-icons

I am having the same error. What can we do to get around this error?

Hey guys, I've just met the same issue after installing this library. The default version in package.json is 6.0.2.

I've solved this problem by below changes:

  1. change configuration in android/build/gradle. This is part of my code:
buildscript {
    repositories {
        jcenter()
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.4'

        // 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()
    }
}

add google() to buildscript and allprojects, and change the gradle version in classpath. Open ...\node_modules\react-native-vector-icons\android\build.gradle, you will find the gradle version in classpath is 3.1.4, that's why we need to make this change.

  1. In your android project, open android/gradle/wrapper/gradle-wrapper.properties, modify the distributionUrl:
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip

Since this library depends on gradle version above 3.1.4, we should set a new version than that.

Rebuild the project, it finally works.

I've solved this problem by below changes . update your project to new version :)

@mrarronz Thank you! I have solved my problem according to your answers, but a mistake may exist in your answer.

1. The first configuration is the android/build/gradle

It should be android/build.gradle

Im got same error any help

sorted out

android.overridePathCheck=true

to

gradle.properties

Was this page helpful?
0 / 5 - 0 ratings