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.
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:+'
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With