I'm trying to run
detox build -c android.emu.release
but it fails when it tries to compile DetoxTest.java
with the following errors
~/android/app/src/androidTest/java/<package_name>/DetoxTest.java:24: error: cannot find symbol
public ActivityTestRule<MainActivity> mActivityRule = new ActivityTestRule<>(MainActivity.class, false, false);
^
symbol: class MainActivity
location: class DetoxTest
~/android/app/src/androidTest/java/<package_name>/DetoxTest.java:24: error: cannot find symbol
public ActivityTestRule<MainActivity> mActivityRule = new ActivityTestRule<>(MainActivity.class, false, false);
^
symbol: class MainActivity
location: class DetoxTest
I tried importing MainActivity from the package but I get the package cannot be found.
RN 0.51.1 Detox: 7.4.3
To solve this issue, follow closely the README for wix/detox/AndroidSupportStatus
For example if your project name is myandroidproject (see property rootProject.name of settings.gradle below), DetoxTest.java will be at the following location inside the package com.myandroidproject.
android/app/src/androidTest/java/com/myandroidproject/DetoxTest.java
package com.myandroidproject
...
settings.gradle
rootProject.name = 'myandroidproject'
...
In your case above, you have to replace package_name appropriately.
Another issue can be if the rootProject.name
has capital letters, like rootProject.name = 'SomeName'
. Then it should be package com.somename
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With