Не удалось найти пакет эспрессо после обновления gradle - PullRequest
0 голосов
/ 06 ноября 2018

Я обновил Gradle и изменил его до 2.3.3 с 3.2.1. все мои эспрессотесты не найдены. невозможно импортировать любой вид эспрессо, просмотр и т. д.

Пожалуйста, найдите скриншот для того же: enter image description here

Мой файл build.gradle выглядит следующим образом:

buildscript {
    repoxxxxxories {
        maven { url 'https://xxxxx/xxxxx' }
    }
    dependencies {
        classpath 'io.fabric.tools:gradle:1.+'
    }
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'

repoxxxxxories {
    maven { url 'https://xxxxx/xxxxx' }
}

apply plugin: 'com.getkeepsafe.dexcount'
apply plugin: 'realm-android'
apply plugin: 'jacoco'

def versionMajor = 4
def versionMinor = 7
def versionPatch = 4



android {

    def calculateVersionCode = { ->
        return versionMajor * 100000 + versionMinor * 1000 + versionPatch
    }

    def getVersionCode = { ->
        return project.hasProperty('versionCode') ? versionCode.toInteger() : 1
    }


    def getVersionName = { ->
        return "${versionMajor}.${versionMinor}.${versionPatch}" + (System.getenv("BUILD_NUMBER")?("."+System.getenv("BUILD_NUMBER")):"") + (project.hasProperty('versionMetadata') ? ("+" + versionMetadata.toString()) : "")
    }

    task versionName {
        println getVersionName()
    }

    task pullScreenshots(type: Exec) {
        commandLine 'bash', 'pull_screenshots.sh'
    }

    lintOptions {
        abortOnError false
    }

    dexOptions {
        jumboMode true
    }

    dataBinding {
        enabled = true
    }

    compileSdkVersion 25
    buildToolsVersion "25.0.2"

    defaultConfig {
        applicationId "com.xxxxx.xxxxx"
        minSdkVersion 19
        targetSdkVersion 25
        versionCode calculateVersionCode()
        versionName getVersionName()
        project.ext.set("archivesBaseName", "xxxxx-xxxxx-" + versionName);
        testApplicationId "com.xxxxx.xxxxx.test"
        //testInstrumentationRunner "com.xxxxx.xxxxx.test.runner.Instrumentation"
        testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner'

        //comment 0710
        //ext.betaDistributionGroupAliases="price-integrity-qa"
        //ext.betaDistributionNotifications=true
    }

    configurations.all {
        resolutionStrategy {
            force 'com.android.support:support-annotations:24.2.1'
            force 'com.android.support:appcompat-v7:24.2.1'
            force 'com.android.support:design:24.2.1'
        }
    }

    sourceSets {
        androidTest {
            assets.srcDirs = ['src/androidTest/assets']
        }
    }

    signingConfigs {
        debug {
            storeFile file("signing/debug.keystore")
        }

        release {
            storeFile file('signing/release.keystore')
            storePassword "AKo38Ah>sON5xoC"
            keyAlias "xxxxx_Release"
            keyPassword "5DeP4nm<e~9kN8B"
        }
    }

    buildTypes {
        debug {
            debuggable true
            minifyEnabled false
            multiDexEnabled true
            testCoverageEnabled = true
        }

        release {
            debuggable false
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            signingConfig signingConfigs.release
        }
    }

    /**
     * Get the xxxxx base api url to be used for this build.
     * @return string If the param -PbaseAPIURL is present then return its value,
     * else the usual xxxxx base API URL.
     */
    def getBaseAPIURL = { ->
        return project.hasProperty('baseAPIURL') ? baseAPIURL : '"https://xxxxx-api.xxxxx.com"'
    }

    def getMockBaseAPIURL = { ->
        return '"http://' + InetAddress.getLocalHost().getHostAddress() + ':9292"'
    }


    productFlavors {

        xxxxxMock {
            applicationIdSuffix ".xxxxx"
            resValue "string", "app_name", "xxxxx - MOCK xxxxx"
            buildConfigField 'String', 'xxxxx', getMockBaseAPIURL()
            buildConfigField 'String', 'xxxxx', '"xxxxx=="'
            buildConfigField 'String', 'xxxxx', '"xxxxx"'
        }

        xxxxx {
            applicationIdSuffix ".xxxxx"
            resValue "string", "app_name", "xxxxx - xxxxx"
            buildConfigField 'String', 'xxxxx', getBaseAPIURL()
            buildConfigField 'String', 'xxxxx', '"xxxxx=="'
            buildConfigField 'String', 'xxxxx', '"xxxxx"'
        }

        xxxxx {
            applicationIdSuffix ".xxxxx"
            resValue "string", "app_name", "xxxxx - xxxxx"
            buildConfigField 'String', 'xxxxx', '"https://xxxxx-api.xxxxx.com"'
            buildConfigField 'String', 'xxxxx', '"xxxxx=="'
            buildConfigField 'String', 'xxxxx', '"xxxxx"'
        }

        xxxxx {
            applicationIdSuffix ".xxxxx"
            resValue "string", "app_name", "xxxxx - xxxxx"
            buildConfigField 'String', 'xxxxx', '"https://xxxxx-api.xxxxx.com"'
            buildConfigField 'String', 'xxxxx', '"xxxxx=="'
            buildConfigField 'String', 'xxxxx', '"xxxxx"'
        }

        production {
            resValue "string", "app_name", "xxxxx"
            buildConfigField 'String', 'xxxxx', '"https://api.xxxxx.com"'
            buildConfigField 'String', 'xxxxx', '"xxxxx=="'
            buildConfigField 'String', 'xxxxx', '"xxxxx"'
        }
    }

    testOptions {
        unitTests.returnDefaultValues = true
    }
}

def supportLibraryVersion = '25.2.0'
def daggerVersion = '2.9'
def lombokVersion = '1.16.10'

dependencies {
    annotationProcessor 'org.parceler:parceler:1.1.9'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.4.0'
    annotationProcessor 'org.projectlombok:lombok:' + lombokVersion
    annotationProcessor 'com.google.dagger:dagger-compiler:' + daggerVersion

    testAnnotationProcessor 'com.google.dagger:dagger-compiler:' + daggerVersion

    androidTestAnnotationProcessor 'com.google.dagger:dagger-compiler:' + daggerVersion
    androidTestCompile 'com.google.dagger:dagger:' + daggerVersion

    testCompile 'junit:junit:4.12'
    testCompile 'org.hamcrest:hamcrest-library:1.3'
    testCompile 'org.mockito:mockito-core:2.5.3'
    testCompile 'org.assertj:assertj-core:2.5.0'
    testCompile 'org.robolectric:robolectric:3.1.2'
    testCompile ('com.squareup.assertj:assertj-android:1.1.1') {
        exclude module: 'support-annotations'
    }
    testCompile 'com.squareup.okhttp3:mockwebserver:3.5.0'

    androidTestCompile 'org.mockito:mockito-core:2.5.3'

    // Realm is applied as a plugin as described in its installation steps.
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.hannesdorfmann.mosby:mvp:2.0.1'
    compile 'com.hannesdorfmann.mosby:viewstate:2.0.1'
    compile 'com.jakewharton:butterknife:8.4.0'
    compile 'com.squareup.retrofit2:retrofit:2.0.2'
    compile 'com.squareup.retrofit2:adapter-rxjava:2.0.2'
    compile 'com.squareup.retrofit2:converter-gson:2.0.2'
    compile 'com.squareup.okhttp3:logging-interceptor:3.5.0'
    compile 'io.reactivex:rxjava:1.1.6'
    compile 'io.reactivex:rxandroid:1.2.1'
    compile 'com.jakewharton.rxbinding:rxbinding:0.4.0'
    compile "com.daimajia.swipelayout:library:1.2.0@aar"
    compile 'com.android.support:support-v4:' + supportLibraryVersion
    compile 'com.android.support:recyclerview-v7:' + supportLibraryVersion
    compile 'com.android.support:appcompat-v7:' + supportLibraryVersion
    compile 'com.android.support:cardview-v7:' + supportLibraryVersion
    compile 'com.android.support:design:' + supportLibraryVersion
    compile 'com.google.android.gms:play-services-analytics:8.4.0'
    compile 'com.journeyapps:zxing-android-embedded:3.5.0@aar'
    compile 'com.google.zxing:core:3.2.1'
    compile 'eu.davidea:flexible-adapter:5.0.0-rc1'
    compile 'org.parceler:parceler-api:1.1.9'
    provided 'org.projectlombok:lombok:' + lombokVersion
    compile 'com.android.support:multidex:1.0.1'
    compile 'com.jakewharton.timber:timber:4.5.1'
    compile 'com.google.dagger:dagger:' + daggerVersion
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile('com.xxxxx.sdk.android:xxxxx:2.6.8@aar') {
        tranxxxxxive = true;
    }
    // added to detect if there are any leakages
    debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5.1'
    releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.1'
    testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.1'
    compile('com.xxxxx.sdk.android:answers:1.3.13@aar') {
        tranxxxxxive = true;
    }


    // For Espresso tests
    compile 'com.android.support:support-annotations:' + supportLibraryVersion
    androidTestCompile('com.android.support.test:runner:0.5') {
        exclude group: 'com.android.support', module: 'support-annotations'
        exclude group: 'com.android.support', module: 'support-v4'
        exclude group: 'com.android.support', module: 'recyclerview-v7'
    }
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2') {
        exclude group: 'com.android.support', module: 'support-annotations'
        exclude group: 'com.android.support', module: 'support-v4'
        exclude group: 'com.android.support', module: 'recyclerview-v7'
    }
    androidTestCompile('com.android.support.test.espresso:espresso-contrib:2.2.2') {
        exclude group: 'com.android.support', module: 'support-annotations'
        exclude group: 'com.android.support', module: 'support-v4'
        exclude group: 'com.android.support', module: 'recyclerview-v7'
        exclude group: 'com.android.support', module: 'appcompat-v7'
        exclude group: 'com.android.support', module: 'design'
    }
    //unused testcompile
    androidTestCompile 'com.android.support.test.espresso:espresso-intents:2.2.2'
    androidTestCompile 'com.android.support.test:rules:0.5'
    // Cucumber
    androidTestCompile('info.cukes:cucumber-android:1.2.4') {
        exclude module: 'cucumber-jvm-deps'
    }
    androidTestCompile('info.cukes:cucumber-picocontainer:1.2.4') {
        exclude module: 'cucumber-jvm-deps'
    }
    androidTestCompile 'info.cukes:cucumber-jvm-deps:1.0.3'
    // Screenshots
    androidTestCompile 'com.squareup.spoon:spoon-client:1.7.1'
}

Пожалуйста, дайте мне знать, какие изменения я должен сделать в gradle? расположение моего эспрессо проекта src> androidTest> java> myproject

...