sakshya73
sakshya73

Reputation: 7212

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.

Upvotes: 6

Views: 23284

Answers (2)

Tejas Rangani
Tejas Rangani

Reputation: 31

-> React Native i18n

  1. Go to node_modules/react-native-i18n/android/build.gradle
  2. -> Under dependencies -> replace compile with implementation

From:

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

To:

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

Upvotes: 0

sakshya73
sakshya73

Reputation: 7212

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:+'
}

Upvotes: 19

Related Questions