react-native构建在Task:app:compileDebugJavaWithJavac处失败,引发错误:包android.support.test.uiautomator不存在

时间:2018-07-17 13:18:25

标签: android react-native android-gradle android-uiautomator detox

我正在测试android上的react-native应用程序,以测试react-native-map标记我已经在main / java / com / mobile / project中添加了react-native本地模块,我正在使用android的uiautomator api测试标记,但是在构建项目时会引发错误:包android.support.test.uiautomator不存在错误。

  

任务:app:compileDebugJavaWithJavac   /home/usr/Projects/repletehealthmobile/android/app/src/main/java/com/mobile/repletehealth/TapMarkerModule.java:13:错误:程序包android.support.test.uiautomator不存在   导入android.support.test.uiautomator.UiDevice;                                          ^   /home/usr/Projects/repletehealthmobile/android/app/src/main/java/com/mobile/repletehealth/TapMarkerModule.java:14:错误:程序包android.support.test.uiautomator不存在   导入android.support.test.uiautomator.UiObject;

我的android / build.gradle有

buildscript {
repositories {
    jcenter()
    google() 
}
dependencies {
    classpath 'com.android.tools.build:gradle:3.0.1' 
}}

allprojects {
repositories {
    mavenLocal()
    jcenter()
    google()
    maven {
        url "$rootDir/../node_modules/react-native/android"
    }
    maven { url "https://jitpack.io" }    // used for MPAndroidChart
    maven { url "https://maven.google.com" }
}

}

和android / app / build.gradle具有

dependencies {
....
 androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.3'
androidTestImplementation(project(path: ":detox"))
androidTestImplementation 'junit:junit:4.12'
androidTestCompile 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test:rules:1.0.1'
}

和gradle-wrapper.properties

`distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists
 distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip`

0 个答案:

没有答案