Android上的React-native - 无法编译应用程序

时间:2018-02-20 01:21:36

标签: detox

我按照所有说明来设置Android但是当我尝试编译它时抱怨它无法找到DetoxTest.java中所需的模块

/Work/mine/detoxJestRn/android/app/src/main/java/com/detoxjestrn/DetoxTest.java:3: error: package android.support.test.filters does not exist
import android.support.test.filters.LargeTest;
                                   ^
/Work/mine/detoxJestRn/android/app/src/main/java/com/detoxjestrn/DetoxTest.java:4: error: package android.support.test.rule does not exist
import android.support.test.rule.ActivityTestRule;
                                ^`

1 个答案:

答案 0 :(得分:1)

您需要将DetoxTest.java文件添加到正确的文件夹(androidTest)中。

例如:

$ find android/app/src -name '*.java'
android/app/src/androidTest/java/com/[your.package]/DetoxTest.java
android/app/src/main/java/com/onova/[your.package]/MainActivity.java
android/app/src/main/java/com/onova/[your.package]/MainApplication.java