Android: no `com.wix.detox.config` package
See original GitHub issueDescribe the bug
Hi, I’m having trouble setting up Detox with a brand new RN project (bootstrapped with npx react-native init example).
I’ve created a minimal example: https://github.com/Tommos0/detox-example . After setting up the new project and following the Detox docs, when I try to build:
$ ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug
> Task :app:stripDebugDebugSymbols UP-TO-DATE
Compatible side by side NDK version was not found.
> Task :app:compileDebugAndroidTestJavaWithJavac FAILED
/p/example/android/app/src/androidTest/java/com/example/DetoxTest.java:5: error: package com.wix.detox.config does not exist
import com.wix.detox.config.DetoxConfig;
^
/p/example/android/app/src/androidTest/java/com/example/DetoxTest.java:25: error: cannot find symbol
DetoxConfig detoxConfig = new DetoxConfig();
^
symbol: class DetoxConfig
location: class DetoxTest
/p/example/android/app/src/androidTest/java/com/example/DetoxTest.java:25: error: cannot find symbol
DetoxConfig detoxConfig = new DetoxConfig();
^
symbol: class DetoxConfig
location: class DetoxTest
3 errors
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileDebugAndroidTestJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
* 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
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.2/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 1s
36 actionable tasks: 2 executed, 34 up-to-date
To Reproduce
- I have tested this issue on the latest Detox release and it still reproduces
Steps to reproduce:
npx react-native init exampleyarn add detox- follow steps at https://github.com/wix/Detox/blob/master/docs/Introduction.Android.md
./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug
Expected behavior It should build
Environment (please complete the following information):
- Detox: 17.3.1
- React Native: 0.63.2
- Java: openjdk version “1.8.0_252”
- OS: Linux Manjaro
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:11
Top Results From Across the Web
Dealing With Problems With Building the App & Detox
This page is about issues related to building the app, typically triggered when running detox build (and not detox test, for example).
Read more >Could not find any matches for com.wix:detox:+ - Stack Overflow
Have you tried adding this to android/build.gradle? // Note: add the 'allproject' section if it doesn't exist allprojects { repositories ...
Read more >React Native development tools - Part 3: Testing tools - Pusher
In this part, look at testing with Jest and Detox. Configure Sublime Text Editor for debugging, and write tests for a sample app....
Read more >Detox - NativeScript Docs
Configure Detox #. Detox must be configued to know the location of the iOS and Android app binary as well as what emulator/simulator...
Read more >Setting Up Detox - ReactNativeTesting.io
First, let's install the global Detox CLI tool: $ xcode-select --install $ brew tap wix/brew $ brew install applesimutils $ npm install -g...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
In my case, I should change order in
build.gradlefor searchingDetoxlib localy and after that in other places. So my config looks like that:Recipe to reproduce:
Result: