Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 572
sakshya73 Avatar asked Jul 11 '26 23:07

sakshya73


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:+'
}
like image 157
sakshya73 Avatar answered Jul 14 '26 13:07

sakshya73



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!