Detox: In detox/build.gradle: Could not find method minReactNative44Implementation()

Description / Steps to Reproduce

  • Update to detox@7.0.0-alpha.0 (on react-native@0.52.0).
  • Run ./gradlew clean from the React Native project’s android/ directory.

This results in the following output:

Running  ./gradlew clean ...
Starting a Gradle Daemon (subsequent builds will be faster)
Reading env from: .env
Reading env from: .env

FAILURE: Build failed with an exception.

* Where:
Build file '/Users/sunw/Skale/Repos/skale-react-native/Skale/node_modules/detox/android/detox/build.gradle' line: 60

* What went wrong:
A problem occurred evaluating project ':detox'.
> Could not find method minReactNative44Implementation() for arguments [com.squareup.okhttp3:okhttp:3.4.1] 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

Detox, Node, Device, Xcode and macOS Versions

  • Detox: 7.0.0-alpha.0
  • Node: 5.6.0
  • Device: MacBook Pro 2016

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 4
  • Comments: 20 (3 by maintainers)

Most upvoted comments

This issue still exists in detox@7.0.1.

Upgrading Gradle worked for me…

Modified build.gradle in the root android folder

 buildscript {
     repositories {
         ....
         google()
     }
     dependencies {
         ....
         classpath 'com.android.tools.build:gradle:3.0.1'
     }
 }

Also had to modify gradle/wrapper/gradle-wrapper.properties off the root Android folder

To make sure gradle package was updated

distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip

And that seemed to work without any issues.