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 "
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:
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.
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
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:
android/build/gradle. This is part of my code:add
google()tobuildscriptandallprojects, 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.android/gradle/wrapper/gradle-wrapper.properties, modify the distributionUrl: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.