0
I am trying to implement the React-Native-maps library in my project, when running React-Native run-android I get this error in CMD:
* Where:
Build file 'C:\Users\Henrique\Documents\New folder\NoExpo\AwesomeProject\node_modules\react-native-maps\lib\android\build.gradle' line: 46
* What went wrong:
A problem occurred evaluating project ':react-native-maps'.
> Could not find method compileOnly() for arguments [com.facebook.react:react-native:+] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
* 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: 7.449 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
I set up the build.Radle file like this:
dependencies {
compile project(':react-native-maps')
compile fileTree(dir: "libs", include: ["*.jar"])
compile "com.android.support:appcompat-v7:23.0.1"
compile "com.facebook.react:react-native:+" // From node_modules
}
What version of Gradle ?
– NoobSaibot
classpath 'com.android.tools.build:Gradle:2.2.3'
– Henrique Hermes
Change to
classpath 'com.android.tools.build:gradle:3.0.1'
and see if it works.– NoobSaibot