Could not find method compile() for arguments [com.facebook.react:react-native:+]

Viewed 349

I am constantly getting this error when I am upgrading my rn version from 0.66.2 to 0.68.2.

What went wrong

A problem occurred evaluating project ':react-native-os'.

Could not find method compile() for arguments [com.facebook.react:react-native:+] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

1 Answers

After some time of deep digging, I figured out that react-native-os is still not compatible with the new version for rn.

This is how I resolved the issue.

Step 1 -> Go to node_modules/react-native-os/android/build.gradle

Step 2 -> Under dependencies -> replace compile with implementation

dependencies {
    compile 'com.facebook.react:react-native:+'
}
dependencies {
    implementation 'com.facebook.react:react-native:+'
}
Related