0

I just started implement Detox for android for my project.

However, I ran into the issue with Error:Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve project :detox'.

I am not sure what did I do wrong when I followed all the step in the Read me file.

Hien Tran
  • 171
  • 1
  • 12
  • which version of detox? – Antoni4 Jan 23 '18 at 16:56
  • Hi @Antoni4, it is ^5.10.0 – Hien Tran Jan 24 '18 at 03:14
  • To be honest I'm getting same error on Detox v.7.0.0-alpha.1 when trying to run on Android. – Antoni4 Jan 25 '18 at 18:07
  • I had a suggestion on GitHub to try use Detox v7.0.1. Are you bound to using v5.10.0? Can you try Detox v7.0.1 instead? – Antoni4 Jan 31 '18 at 11:53
  • I tried using npm update to update the detox. But after it, it is still 5.10.0. And I am unsure if 5.10.0 can run with react native 0.48.4 or not. Because we might need to stick with this react native version. thanks for your response. – Hien Tran Jan 31 '18 at 23:56
  • And if the v7.0.1 can use with RN 0.48.4. would it also resolve the issue with nested scrollview? Thanks @Antoni4 – Hien Tran Feb 01 '18 at 04:14
  • As I updated to the latest v7 detox. I still give the issue. – Hien Tran Feb 02 '18 at 13:53
  • [error](https://user-images.githubusercontent.com/8481265/35736617-cb311b2e-087c-11e8-80d3-0270ee13f0c0.png) – Hien Tran Feb 02 '18 at 13:54
  • I haven't tried the latest Detox yet, i'll let you know once I also try – Antoni4 Feb 02 '18 at 13:58
  • Thanks @Antoni4, I am unsure if something is wrong with my own project or my PC. – Hien Tran Feb 03 '18 at 06:57
  • Hi @Antoni4, I managed to make it work using commented out some package error after checking the trace as well as choosing a newer version than the 'react-native-generated' dependencies in the build.gradle – Hien Tran Feb 03 '18 at 11:32
  • Awesome, is this with v7.0.1 or v5.10.0? Can you please post your result as an answer, then accept it after 24 hours? So that your question will be marked as resolved. – Antoni4 Feb 03 '18 at 11:35
  • @Antoni4, Thanks, I just did, thanks for your help. I got a question about permission on Android for Detox as well, if you can help. I just post it. – Hien Tran Feb 03 '18 at 11:48

1 Answers1

0

The version of Detox is 7.0.1 and React Native 0.48.4

I managed to make it work by

androidTestImplementation(project(path: ":detox")) {
    exclude group: 'com.android.support', module: 'support-annotations'
}
androidTestImplementation 'junit:junit:4.12', {
    exclude group: 'com.android.support', module: 'support-annotations'
}
androidTestImplementation 'com.android.support.test:runner:1.0.1', {
    exclude group: 'com.android.support', module: 'support-annotations'
}
androidTestImplementation 'com.android.support.test:rules:1.0.1', {
    exclude group: 'com.android.support', module: 'support-annotations'
}

Also later on, I ran into app crashes immediately, So I checked around and the solution for the app crashed after react-native run-android or detox test is some dependencies version, especially about gsm and as such.

Hien Tran
  • 171
  • 1
  • 12
  • hi :) Don't forget to mark this as accepted answer, so that your questions is marked as resovled – Antoni4 Feb 12 '18 at 23:16
  • hi @Antoni4, thanks for this, I have been waiting for checking my answer. But I didn't know I need to pick the tick . keep trying to upvote my answer hahaha. Thanks – Hien Tran Feb 22 '18 at 05:58