Chris Bolton
Chris Bolton

Reputation: 51

Could not find any matches for com.wix:detox:+

Trying to run detox on my android device and running into the following error:

> Configure project :react-native-firebase
react-native-firebase: using React Native prebuilt binary from /Users/m/Desktop/alohapass-business/node_modules/react-native/android

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:compileStagingDebugAndroidTestJavaWithJavac'.
> Could not resolve all task dependencies for configuration ':app:stagingDebugAndroidTestCompileClasspath'.
   > Could not find any matches for com.wix:detox:+ as no versions of com.wix:detox are available.
     Required by:
         project :app

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 8s

I have androidTestImplementation('com.wix:detox:+') { transitive = true } in my build.gradle and am running ./gradlew assembleAndroidTest.

Any ideas?

Upvotes: 4

Views: 2513

Answers (4)

Reinis
Reinis

Reputation: 19

Well if you get here make sure you put it under allprojects and not buildscript

Upvotes: 1

sam k
sam k

Reputation: 1107

Yes both answers directed me to fix the path to my node module package. Copying code from Detox document would give me the wrong path to the package.

Upvotes: 0

Victor Pacheo
Victor Pacheo

Reputation: 131

I had to change the url from the documentation, to match the real path of Detox module, like this:

allprojects {
    repositories {
        google()
        maven {
            // All of Detox' artifacts are provided via the npm module
            url "$rootDir/node_modules/detox/Detox-android"
        }
        println  "rootDir: ${rootDir}"
    }
}

Try to validate what is the actual path of rootDir to find out whether you also need to do this.

You can print it by adding the following line to your Gradle file:

println "rootDir: ${rootDir}"

Hope it helps.

Upvotes: 1

Mikel Ros
Mikel Ros

Reputation: 11

Have you tried adding this to android/build.gradle?

// Note: add the 'allproject' section if it doesn't exist
allprojects {
    repositories {
        // ...
        google()
        maven {
            // All of Detox' artifacts are provided via the npm module
            url "$rootDir/../node_modules/detox/Detox-android"
        }
    }
}

Upvotes: 1

Related Questions