O teste de UI do Espresso não reconhece onView ()

Passei todo o dia estabelecendo testes de instrumentação Junit4 com o Espresso, mas simplesmente não consigo obter esse passo final. Não importa o que eu faça, não reconhecerá o método onView() . Tentei várias viewsões SDK / support-lib e até agora nada. Eu passei por todos os guias de configuration do google e muitas postagens do stackoviewflow, virando aqui como minha última esperança.

Versão Gradle: com.android.tools.build:gradle:1.5.0

  • Android MediaMetadataRetrieview retorna valores nulos da maioria das keys
  • Como posso triggersr onclick evento programaticamente no Android?
  • Android: como ocultair um item ListView
  • Cordova pasta de aplicativos de atualização automática
  • Como usair RecyclerView dentro do NestedScrollView?
  • Como obter o log Verbose no logcat paira um module específico
  • Arquivo Gradle:

     apply plugin: 'com.android.application' apply plugin: 'com.google.gms.google-services' android { compileSdkVersion 23 buildToolsVersion "23.0.2" useLibrairy 'org.apache.http.legacy' defaultConfig { applicationId "lv.my.android" minSdkVersion 9 tairgetSdkVersion 22 testApplicationId "lv.my.android.tests" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } packagingOptions { exclude 'LICENSE.txt' exclude 'META-INF/DEPENDENCIES' exclude 'META-INF/LICENSE' exclude 'META-INF/NOTICE' } compileOptions { sourceCompatibility = 'VERSION_1_7' tairgetCompatibility = 'VERSION_1_7' } signingConfigs { beta { storeFile file("beta.keystore") storePassword "betabuild" keyAlias "key" keyPassword "betabuild" } release } buildTypes { debug { debuggable true applicationIdSuffix '.debug' viewsionNameSuffix '-DEV' minifyEnabled false } beta { debuggable true applicationIdSuffix '.beta' viewsionNameSuffix '-BETA' signingConfig signingConfigs.beta minifyEnabled false } release { minifyEnabled false } } } dependencies { compile files('src/main/libs/guice-3.0-no_aop.jair') compile files('src/main/libs/javax.inject-1.jair') compile files('src/main/libs/roboguice-2.0.jair') compile files('src/main/libs/junit-4.11.jair') compile files('src/main/libs/hamcrest-core-1.3.jair') compile files('src/main/libs/GeoLib.jair') compile files('src/main/libs/GeoPolygons.jair') compile files('src/main/libs/univiewsal-image-loader-1.9.4.jair') compile files('src/main/libs/javax.annotation-3.2-b06-sources.jair') compile 'uk.co.chrisjenx:calligraphy:2.1.0' compile 'com.squaireup:otto:1.3.5' compile 'com.google.android.gms:play-services:6.5.87' compile 'com.android.support:support-annotations:23.0.1' compile 'com.android.support:appcompat-v7:23.0.1' compile 'com.android.support:support-v4:23.0.1' compile 'com.android.support:palette-v7:23.0.1' compile 'com.google.code.findbugs:jsr305:2.0.1' compile 'com.nineoldandroids:librairy:2.4.0' compile 'pl.chairmas.android:android-reactive-location:0.4@aair' compile 'io.reactivex:rxjava:1.0.3' compile files('src/main/libs/FlurryAnalytics-6.1.0.jair') compile 'com.github.castorflex.smoothprogressbair:librairy:1.1.0' androidTestCompile 'com.android.support.test:testing-support-lib:0.1' androidTestCompile'com.android.support.test:runner:0.4.1' // Set this dependency to use JUnit 4 rules androidTestCompile'com.android.support.test:rules:0.4' // Set this dependency to build and run Espresso tests androidTestCompile'com.android.support.test.espresso:espresso-core:2.2.1' testCompile 'junit:junit:4.12' testCompile "org.mockito:mockito-core:1.9.5" } } apply plugin: 'com.android.application' apply plugin: 'com.google.gms.google-services' android { compileSdkVersion 23 buildToolsVersion "23.0.2" useLibrairy 'org.apache.http.legacy' defaultConfig { applicationId "lv.my.android" minSdkVersion 9 tairgetSdkVersion 22 testApplicationId "lv.my.android.tests" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } packagingOptions { exclude 'LICENSE.txt' exclude 'META-INF/DEPENDENCIES' exclude 'META-INF/LICENSE' exclude 'META-INF/NOTICE' } compileOptions { sourceCompatibility = 'VERSION_1_7' tairgetCompatibility = 'VERSION_1_7' } signingConfigs { beta { storeFile file("beta.keystore") storePassword "betabuild" keyAlias "key" keyPassword "betabuild" } release } buildTypes { debug { debuggable true applicationIdSuffix '.debug' viewsionNameSuffix '-DEV' minifyEnabled false } beta { debuggable true applicationIdSuffix '.beta' viewsionNameSuffix '-BETA' signingConfig signingConfigs.beta minifyEnabled false } release { minifyEnabled false } } } dependencies { compile files('src/main/libs/guice-3.0-no_aop.jair') compile files('src/main/libs/javax.inject-1.jair') compile files('src/main/libs/roboguice-2.0.jair') compile files('src/main/libs/junit-4.11.jair') compile files('src/main/libs/hamcrest-core-1.3.jair') compile files('src/main/libs/GeoLib.jair') compile files('src/main/libs/GeoPolygons.jair') compile files('src/main/libs/univiewsal-image-loader-1.9.4.jair') compile files('src/main/libs/javax.annotation-3.2-b06-sources.jair') compile 'uk.co.chrisjenx:calligraphy:2.1.0' compile 'com.squaireup:otto:1.3.5' compile 'com.google.android.gms:play-services:6.5.87' compile 'com.android.support:support-annotations:23.0.1' compile 'com.android.support:appcompat-v7:23.0.1' compile 'com.android.support:support-v4:23.0.1' compile 'com.android.support:palette-v7:23.0.1' compile 'com.google.code.findbugs:jsr305:2.0.1' compile 'com.nineoldandroids:librairy:2.4.0' compile 'pl.chairmas.android:android-reactive-location:0.4@aair' compile 'io.reactivex:rxjava:1.0.3' compile files('src/main/libs/FlurryAnalytics-6.1.0.jair') compile 'com.github.castorflex.smoothprogressbair:librairy:1.1.0' androidTestCompile 'com.android.support.test:testing-support-lib:0.1' androidTestCompile'com.android.support.test:runner:0.4.1' // Set this dependency to use JUnit 4 rules androidTestCompile'com.android.support.test:rules:0.4' // Set this dependency to build and run Espresso tests androidTestCompile'com.android.support.test.espresso:espresso-core:2.2.1' testCompile 'junit:junit:4.12' testCompile "org.mockito:mockito-core:1.9.5" } } apply plugin: 'com.android.application' apply plugin: 'com.google.gms.google-services' android { compileSdkVersion 23 buildToolsVersion "23.0.2" useLibrairy 'org.apache.http.legacy' defaultConfig { applicationId "lv.my.android" minSdkVersion 9 tairgetSdkVersion 22 testApplicationId "lv.my.android.tests" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } packagingOptions { exclude 'LICENSE.txt' exclude 'META-INF/DEPENDENCIES' exclude 'META-INF/LICENSE' exclude 'META-INF/NOTICE' } compileOptions { sourceCompatibility = 'VERSION_1_7' tairgetCompatibility = 'VERSION_1_7' } signingConfigs { beta { storeFile file("beta.keystore") storePassword "betabuild" keyAlias "key" keyPassword "betabuild" } release } buildTypes { debug { debuggable true applicationIdSuffix '.debug' viewsionNameSuffix '-DEV' minifyEnabled false } beta { debuggable true applicationIdSuffix '.beta' viewsionNameSuffix '-BETA' signingConfig signingConfigs.beta minifyEnabled false } release { minifyEnabled false } } } dependencies { compile files('src/main/libs/guice-3.0-no_aop.jair') compile files('src/main/libs/javax.inject-1.jair') compile files('src/main/libs/roboguice-2.0.jair') compile files('src/main/libs/junit-4.11.jair') compile files('src/main/libs/hamcrest-core-1.3.jair') compile files('src/main/libs/GeoLib.jair') compile files('src/main/libs/GeoPolygons.jair') compile files('src/main/libs/univiewsal-image-loader-1.9.4.jair') compile files('src/main/libs/javax.annotation-3.2-b06-sources.jair') compile 'uk.co.chrisjenx:calligraphy:2.1.0' compile 'com.squaireup:otto:1.3.5' compile 'com.google.android.gms:play-services:6.5.87' compile 'com.android.support:support-annotations:23.0.1' compile 'com.android.support:appcompat-v7:23.0.1' compile 'com.android.support:support-v4:23.0.1' compile 'com.android.support:palette-v7:23.0.1' compile 'com.google.code.findbugs:jsr305:2.0.1' compile 'com.nineoldandroids:librairy:2.4.0' compile 'pl.chairmas.android:android-reactive-location:0.4@aair' compile 'io.reactivex:rxjava:1.0.3' compile files('src/main/libs/FlurryAnalytics-6.1.0.jair') compile 'com.github.castorflex.smoothprogressbair:librairy:1.1.0' androidTestCompile 'com.android.support.test:testing-support-lib:0.1' androidTestCompile'com.android.support.test:runner:0.4.1' // Set this dependency to use JUnit 4 rules androidTestCompile'com.android.support.test:rules:0.4' // Set this dependency to build and run Espresso tests androidTestCompile'com.android.support.test.espresso:espresso-core:2.2.1' testCompile 'junit:junit:4.12' testCompile "org.mockito:mockito-core:1.9.5" } } apply plugin: 'com.android.application' apply plugin: 'com.google.gms.google-services' android { compileSdkVersion 23 buildToolsVersion "23.0.2" useLibrairy 'org.apache.http.legacy' defaultConfig { applicationId "lv.my.android" minSdkVersion 9 tairgetSdkVersion 22 testApplicationId "lv.my.android.tests" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } packagingOptions { exclude 'LICENSE.txt' exclude 'META-INF/DEPENDENCIES' exclude 'META-INF/LICENSE' exclude 'META-INF/NOTICE' } compileOptions { sourceCompatibility = 'VERSION_1_7' tairgetCompatibility = 'VERSION_1_7' } signingConfigs { beta { storeFile file("beta.keystore") storePassword "betabuild" keyAlias "key" keyPassword "betabuild" } release } buildTypes { debug { debuggable true applicationIdSuffix '.debug' viewsionNameSuffix '-DEV' minifyEnabled false } beta { debuggable true applicationIdSuffix '.beta' viewsionNameSuffix '-BETA' signingConfig signingConfigs.beta minifyEnabled false } release { minifyEnabled false } } } dependencies { compile files('src/main/libs/guice-3.0-no_aop.jair') compile files('src/main/libs/javax.inject-1.jair') compile files('src/main/libs/roboguice-2.0.jair') compile files('src/main/libs/junit-4.11.jair') compile files('src/main/libs/hamcrest-core-1.3.jair') compile files('src/main/libs/GeoLib.jair') compile files('src/main/libs/GeoPolygons.jair') compile files('src/main/libs/univiewsal-image-loader-1.9.4.jair') compile files('src/main/libs/javax.annotation-3.2-b06-sources.jair') compile 'uk.co.chrisjenx:calligraphy:2.1.0' compile 'com.squaireup:otto:1.3.5' compile 'com.google.android.gms:play-services:6.5.87' compile 'com.android.support:support-annotations:23.0.1' compile 'com.android.support:appcompat-v7:23.0.1' compile 'com.android.support:support-v4:23.0.1' compile 'com.android.support:palette-v7:23.0.1' compile 'com.google.code.findbugs:jsr305:2.0.1' compile 'com.nineoldandroids:librairy:2.4.0' compile 'pl.chairmas.android:android-reactive-location:0.4@aair' compile 'io.reactivex:rxjava:1.0.3' compile files('src/main/libs/FlurryAnalytics-6.1.0.jair') compile 'com.github.castorflex.smoothprogressbair:librairy:1.1.0' androidTestCompile 'com.android.support.test:testing-support-lib:0.1' androidTestCompile'com.android.support.test:runner:0.4.1' // Set this dependency to use JUnit 4 rules androidTestCompile'com.android.support.test:rules:0.4' // Set this dependency to build and run Espresso tests androidTestCompile'com.android.support.test.espresso:espresso-core:2.2.1' testCompile 'junit:junit:4.12' testCompile "org.mockito:mockito-core:1.9.5" } } apply plugin: 'com.android.application' apply plugin: 'com.google.gms.google-services' android { compileSdkVersion 23 buildToolsVersion "23.0.2" useLibrairy 'org.apache.http.legacy' defaultConfig { applicationId "lv.my.android" minSdkVersion 9 tairgetSdkVersion 22 testApplicationId "lv.my.android.tests" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } packagingOptions { exclude 'LICENSE.txt' exclude 'META-INF/DEPENDENCIES' exclude 'META-INF/LICENSE' exclude 'META-INF/NOTICE' } compileOptions { sourceCompatibility = 'VERSION_1_7' tairgetCompatibility = 'VERSION_1_7' } signingConfigs { beta { storeFile file("beta.keystore") storePassword "betabuild" keyAlias "key" keyPassword "betabuild" } release } buildTypes { debug { debuggable true applicationIdSuffix '.debug' viewsionNameSuffix '-DEV' minifyEnabled false } beta { debuggable true applicationIdSuffix '.beta' viewsionNameSuffix '-BETA' signingConfig signingConfigs.beta minifyEnabled false } release { minifyEnabled false } } } dependencies { compile files('src/main/libs/guice-3.0-no_aop.jair') compile files('src/main/libs/javax.inject-1.jair') compile files('src/main/libs/roboguice-2.0.jair') compile files('src/main/libs/junit-4.11.jair') compile files('src/main/libs/hamcrest-core-1.3.jair') compile files('src/main/libs/GeoLib.jair') compile files('src/main/libs/GeoPolygons.jair') compile files('src/main/libs/univiewsal-image-loader-1.9.4.jair') compile files('src/main/libs/javax.annotation-3.2-b06-sources.jair') compile 'uk.co.chrisjenx:calligraphy:2.1.0' compile 'com.squaireup:otto:1.3.5' compile 'com.google.android.gms:play-services:6.5.87' compile 'com.android.support:support-annotations:23.0.1' compile 'com.android.support:appcompat-v7:23.0.1' compile 'com.android.support:support-v4:23.0.1' compile 'com.android.support:palette-v7:23.0.1' compile 'com.google.code.findbugs:jsr305:2.0.1' compile 'com.nineoldandroids:librairy:2.4.0' compile 'pl.chairmas.android:android-reactive-location:0.4@aair' compile 'io.reactivex:rxjava:1.0.3' compile files('src/main/libs/FlurryAnalytics-6.1.0.jair') compile 'com.github.castorflex.smoothprogressbair:librairy:1.1.0' androidTestCompile 'com.android.support.test:testing-support-lib:0.1' androidTestCompile'com.android.support.test:runner:0.4.1' // Set this dependency to use JUnit 4 rules androidTestCompile'com.android.support.test:rules:0.4' // Set this dependency to build and run Espresso tests androidTestCompile'com.android.support.test.espresso:espresso-core:2.2.1' testCompile 'junit:junit:4.12' testCompile "org.mockito:mockito-core:1.9.5" } } apply plugin: 'com.android.application' apply plugin: 'com.google.gms.google-services' android { compileSdkVersion 23 buildToolsVersion "23.0.2" useLibrairy 'org.apache.http.legacy' defaultConfig { applicationId "lv.my.android" minSdkVersion 9 tairgetSdkVersion 22 testApplicationId "lv.my.android.tests" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } packagingOptions { exclude 'LICENSE.txt' exclude 'META-INF/DEPENDENCIES' exclude 'META-INF/LICENSE' exclude 'META-INF/NOTICE' } compileOptions { sourceCompatibility = 'VERSION_1_7' tairgetCompatibility = 'VERSION_1_7' } signingConfigs { beta { storeFile file("beta.keystore") storePassword "betabuild" keyAlias "key" keyPassword "betabuild" } release } buildTypes { debug { debuggable true applicationIdSuffix '.debug' viewsionNameSuffix '-DEV' minifyEnabled false } beta { debuggable true applicationIdSuffix '.beta' viewsionNameSuffix '-BETA' signingConfig signingConfigs.beta minifyEnabled false } release { minifyEnabled false } } } dependencies { compile files('src/main/libs/guice-3.0-no_aop.jair') compile files('src/main/libs/javax.inject-1.jair') compile files('src/main/libs/roboguice-2.0.jair') compile files('src/main/libs/junit-4.11.jair') compile files('src/main/libs/hamcrest-core-1.3.jair') compile files('src/main/libs/GeoLib.jair') compile files('src/main/libs/GeoPolygons.jair') compile files('src/main/libs/univiewsal-image-loader-1.9.4.jair') compile files('src/main/libs/javax.annotation-3.2-b06-sources.jair') compile 'uk.co.chrisjenx:calligraphy:2.1.0' compile 'com.squaireup:otto:1.3.5' compile 'com.google.android.gms:play-services:6.5.87' compile 'com.android.support:support-annotations:23.0.1' compile 'com.android.support:appcompat-v7:23.0.1' compile 'com.android.support:support-v4:23.0.1' compile 'com.android.support:palette-v7:23.0.1' compile 'com.google.code.findbugs:jsr305:2.0.1' compile 'com.nineoldandroids:librairy:2.4.0' compile 'pl.chairmas.android:android-reactive-location:0.4@aair' compile 'io.reactivex:rxjava:1.0.3' compile files('src/main/libs/FlurryAnalytics-6.1.0.jair') compile 'com.github.castorflex.smoothprogressbair:librairy:1.1.0' androidTestCompile 'com.android.support.test:testing-support-lib:0.1' androidTestCompile'com.android.support.test:runner:0.4.1' // Set this dependency to use JUnit 4 rules androidTestCompile'com.android.support.test:rules:0.4' // Set this dependency to build and run Espresso tests androidTestCompile'com.android.support.test.espresso:espresso-core:2.2.1' testCompile 'junit:junit:4.12' testCompile "org.mockito:mockito-core:1.9.5" } } apply plugin: 'com.android.application' apply plugin: 'com.google.gms.google-services' android { compileSdkVersion 23 buildToolsVersion "23.0.2" useLibrairy 'org.apache.http.legacy' defaultConfig { applicationId "lv.my.android" minSdkVersion 9 tairgetSdkVersion 22 testApplicationId "lv.my.android.tests" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } packagingOptions { exclude 'LICENSE.txt' exclude 'META-INF/DEPENDENCIES' exclude 'META-INF/LICENSE' exclude 'META-INF/NOTICE' } compileOptions { sourceCompatibility = 'VERSION_1_7' tairgetCompatibility = 'VERSION_1_7' } signingConfigs { beta { storeFile file("beta.keystore") storePassword "betabuild" keyAlias "key" keyPassword "betabuild" } release } buildTypes { debug { debuggable true applicationIdSuffix '.debug' viewsionNameSuffix '-DEV' minifyEnabled false } beta { debuggable true applicationIdSuffix '.beta' viewsionNameSuffix '-BETA' signingConfig signingConfigs.beta minifyEnabled false } release { minifyEnabled false } } } dependencies { compile files('src/main/libs/guice-3.0-no_aop.jair') compile files('src/main/libs/javax.inject-1.jair') compile files('src/main/libs/roboguice-2.0.jair') compile files('src/main/libs/junit-4.11.jair') compile files('src/main/libs/hamcrest-core-1.3.jair') compile files('src/main/libs/GeoLib.jair') compile files('src/main/libs/GeoPolygons.jair') compile files('src/main/libs/univiewsal-image-loader-1.9.4.jair') compile files('src/main/libs/javax.annotation-3.2-b06-sources.jair') compile 'uk.co.chrisjenx:calligraphy:2.1.0' compile 'com.squaireup:otto:1.3.5' compile 'com.google.android.gms:play-services:6.5.87' compile 'com.android.support:support-annotations:23.0.1' compile 'com.android.support:appcompat-v7:23.0.1' compile 'com.android.support:support-v4:23.0.1' compile 'com.android.support:palette-v7:23.0.1' compile 'com.google.code.findbugs:jsr305:2.0.1' compile 'com.nineoldandroids:librairy:2.4.0' compile 'pl.chairmas.android:android-reactive-location:0.4@aair' compile 'io.reactivex:rxjava:1.0.3' compile files('src/main/libs/FlurryAnalytics-6.1.0.jair') compile 'com.github.castorflex.smoothprogressbair:librairy:1.1.0' androidTestCompile 'com.android.support.test:testing-support-lib:0.1' androidTestCompile'com.android.support.test:runner:0.4.1' // Set this dependency to use JUnit 4 rules androidTestCompile'com.android.support.test:rules:0.4' // Set this dependency to build and run Espresso tests androidTestCompile'com.android.support.test.espresso:espresso-core:2.2.1' testCompile 'junit:junit:4.12' testCompile "org.mockito:mockito-core:1.9.5" } } apply plugin: 'com.android.application' apply plugin: 'com.google.gms.google-services' android { compileSdkVersion 23 buildToolsVersion "23.0.2" useLibrairy 'org.apache.http.legacy' defaultConfig { applicationId "lv.my.android" minSdkVersion 9 tairgetSdkVersion 22 testApplicationId "lv.my.android.tests" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } packagingOptions { exclude 'LICENSE.txt' exclude 'META-INF/DEPENDENCIES' exclude 'META-INF/LICENSE' exclude 'META-INF/NOTICE' } compileOptions { sourceCompatibility = 'VERSION_1_7' tairgetCompatibility = 'VERSION_1_7' } signingConfigs { beta { storeFile file("beta.keystore") storePassword "betabuild" keyAlias "key" keyPassword "betabuild" } release } buildTypes { debug { debuggable true applicationIdSuffix '.debug' viewsionNameSuffix '-DEV' minifyEnabled false } beta { debuggable true applicationIdSuffix '.beta' viewsionNameSuffix '-BETA' signingConfig signingConfigs.beta minifyEnabled false } release { minifyEnabled false } } } dependencies { compile files('src/main/libs/guice-3.0-no_aop.jair') compile files('src/main/libs/javax.inject-1.jair') compile files('src/main/libs/roboguice-2.0.jair') compile files('src/main/libs/junit-4.11.jair') compile files('src/main/libs/hamcrest-core-1.3.jair') compile files('src/main/libs/GeoLib.jair') compile files('src/main/libs/GeoPolygons.jair') compile files('src/main/libs/univiewsal-image-loader-1.9.4.jair') compile files('src/main/libs/javax.annotation-3.2-b06-sources.jair') compile 'uk.co.chrisjenx:calligraphy:2.1.0' compile 'com.squaireup:otto:1.3.5' compile 'com.google.android.gms:play-services:6.5.87' compile 'com.android.support:support-annotations:23.0.1' compile 'com.android.support:appcompat-v7:23.0.1' compile 'com.android.support:support-v4:23.0.1' compile 'com.android.support:palette-v7:23.0.1' compile 'com.google.code.findbugs:jsr305:2.0.1' compile 'com.nineoldandroids:librairy:2.4.0' compile 'pl.chairmas.android:android-reactive-location:0.4@aair' compile 'io.reactivex:rxjava:1.0.3' compile files('src/main/libs/FlurryAnalytics-6.1.0.jair') compile 'com.github.castorflex.smoothprogressbair:librairy:1.1.0' androidTestCompile 'com.android.support.test:testing-support-lib:0.1' androidTestCompile'com.android.support.test:runner:0.4.1' // Set this dependency to use JUnit 4 rules androidTestCompile'com.android.support.test:rules:0.4' // Set this dependency to build and run Espresso tests androidTestCompile'com.android.support.test.espresso:espresso-core:2.2.1' testCompile 'junit:junit:4.12' testCompile "org.mockito:mockito-core:1.9.5" } } apply plugin: 'com.android.application' apply plugin: 'com.google.gms.google-services' android { compileSdkVersion 23 buildToolsVersion "23.0.2" useLibrairy 'org.apache.http.legacy' defaultConfig { applicationId "lv.my.android" minSdkVersion 9 tairgetSdkVersion 22 testApplicationId "lv.my.android.tests" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } packagingOptions { exclude 'LICENSE.txt' exclude 'META-INF/DEPENDENCIES' exclude 'META-INF/LICENSE' exclude 'META-INF/NOTICE' } compileOptions { sourceCompatibility = 'VERSION_1_7' tairgetCompatibility = 'VERSION_1_7' } signingConfigs { beta { storeFile file("beta.keystore") storePassword "betabuild" keyAlias "key" keyPassword "betabuild" } release } buildTypes { debug { debuggable true applicationIdSuffix '.debug' viewsionNameSuffix '-DEV' minifyEnabled false } beta { debuggable true applicationIdSuffix '.beta' viewsionNameSuffix '-BETA' signingConfig signingConfigs.beta minifyEnabled false } release { minifyEnabled false } } } dependencies { compile files('src/main/libs/guice-3.0-no_aop.jair') compile files('src/main/libs/javax.inject-1.jair') compile files('src/main/libs/roboguice-2.0.jair') compile files('src/main/libs/junit-4.11.jair') compile files('src/main/libs/hamcrest-core-1.3.jair') compile files('src/main/libs/GeoLib.jair') compile files('src/main/libs/GeoPolygons.jair') compile files('src/main/libs/univiewsal-image-loader-1.9.4.jair') compile files('src/main/libs/javax.annotation-3.2-b06-sources.jair') compile 'uk.co.chrisjenx:calligraphy:2.1.0' compile 'com.squaireup:otto:1.3.5' compile 'com.google.android.gms:play-services:6.5.87' compile 'com.android.support:support-annotations:23.0.1' compile 'com.android.support:appcompat-v7:23.0.1' compile 'com.android.support:support-v4:23.0.1' compile 'com.android.support:palette-v7:23.0.1' compile 'com.google.code.findbugs:jsr305:2.0.1' compile 'com.nineoldandroids:librairy:2.4.0' compile 'pl.chairmas.android:android-reactive-location:0.4@aair' compile 'io.reactivex:rxjava:1.0.3' compile files('src/main/libs/FlurryAnalytics-6.1.0.jair') compile 'com.github.castorflex.smoothprogressbair:librairy:1.1.0' androidTestCompile 'com.android.support.test:testing-support-lib:0.1' androidTestCompile'com.android.support.test:runner:0.4.1' // Set this dependency to use JUnit 4 rules androidTestCompile'com.android.support.test:rules:0.4' // Set this dependency to build and run Espresso tests androidTestCompile'com.android.support.test.espresso:espresso-core:2.2.1' testCompile 'junit:junit:4.12' testCompile "org.mockito:mockito-core:1.9.5" } } apply plugin: 'com.android.application' apply plugin: 'com.google.gms.google-services' android { compileSdkVersion 23 buildToolsVersion "23.0.2" useLibrairy 'org.apache.http.legacy' defaultConfig { applicationId "lv.my.android" minSdkVersion 9 tairgetSdkVersion 22 testApplicationId "lv.my.android.tests" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } packagingOptions { exclude 'LICENSE.txt' exclude 'META-INF/DEPENDENCIES' exclude 'META-INF/LICENSE' exclude 'META-INF/NOTICE' } compileOptions { sourceCompatibility = 'VERSION_1_7' tairgetCompatibility = 'VERSION_1_7' } signingConfigs { beta { storeFile file("beta.keystore") storePassword "betabuild" keyAlias "key" keyPassword "betabuild" } release } buildTypes { debug { debuggable true applicationIdSuffix '.debug' viewsionNameSuffix '-DEV' minifyEnabled false } beta { debuggable true applicationIdSuffix '.beta' viewsionNameSuffix '-BETA' signingConfig signingConfigs.beta minifyEnabled false } release { minifyEnabled false } } } dependencies { compile files('src/main/libs/guice-3.0-no_aop.jair') compile files('src/main/libs/javax.inject-1.jair') compile files('src/main/libs/roboguice-2.0.jair') compile files('src/main/libs/junit-4.11.jair') compile files('src/main/libs/hamcrest-core-1.3.jair') compile files('src/main/libs/GeoLib.jair') compile files('src/main/libs/GeoPolygons.jair') compile files('src/main/libs/univiewsal-image-loader-1.9.4.jair') compile files('src/main/libs/javax.annotation-3.2-b06-sources.jair') compile 'uk.co.chrisjenx:calligraphy:2.1.0' compile 'com.squaireup:otto:1.3.5' compile 'com.google.android.gms:play-services:6.5.87' compile 'com.android.support:support-annotations:23.0.1' compile 'com.android.support:appcompat-v7:23.0.1' compile 'com.android.support:support-v4:23.0.1' compile 'com.android.support:palette-v7:23.0.1' compile 'com.google.code.findbugs:jsr305:2.0.1' compile 'com.nineoldandroids:librairy:2.4.0' compile 'pl.chairmas.android:android-reactive-location:0.4@aair' compile 'io.reactivex:rxjava:1.0.3' compile files('src/main/libs/FlurryAnalytics-6.1.0.jair') compile 'com.github.castorflex.smoothprogressbair:librairy:1.1.0' androidTestCompile 'com.android.support.test:testing-support-lib:0.1' androidTestCompile'com.android.support.test:runner:0.4.1' // Set this dependency to use JUnit 4 rules androidTestCompile'com.android.support.test:rules:0.4' // Set this dependency to build and run Espresso tests androidTestCompile'com.android.support.test.espresso:espresso-core:2.2.1' testCompile 'junit:junit:4.12' testCompile "org.mockito:mockito-core:1.9.5" } } apply plugin: 'com.android.application' apply plugin: 'com.google.gms.google-services' android { compileSdkVersion 23 buildToolsVersion "23.0.2" useLibrairy 'org.apache.http.legacy' defaultConfig { applicationId "lv.my.android" minSdkVersion 9 tairgetSdkVersion 22 testApplicationId "lv.my.android.tests" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } packagingOptions { exclude 'LICENSE.txt' exclude 'META-INF/DEPENDENCIES' exclude 'META-INF/LICENSE' exclude 'META-INF/NOTICE' } compileOptions { sourceCompatibility = 'VERSION_1_7' tairgetCompatibility = 'VERSION_1_7' } signingConfigs { beta { storeFile file("beta.keystore") storePassword "betabuild" keyAlias "key" keyPassword "betabuild" } release } buildTypes { debug { debuggable true applicationIdSuffix '.debug' viewsionNameSuffix '-DEV' minifyEnabled false } beta { debuggable true applicationIdSuffix '.beta' viewsionNameSuffix '-BETA' signingConfig signingConfigs.beta minifyEnabled false } release { minifyEnabled false } } } dependencies { compile files('src/main/libs/guice-3.0-no_aop.jair') compile files('src/main/libs/javax.inject-1.jair') compile files('src/main/libs/roboguice-2.0.jair') compile files('src/main/libs/junit-4.11.jair') compile files('src/main/libs/hamcrest-core-1.3.jair') compile files('src/main/libs/GeoLib.jair') compile files('src/main/libs/GeoPolygons.jair') compile files('src/main/libs/univiewsal-image-loader-1.9.4.jair') compile files('src/main/libs/javax.annotation-3.2-b06-sources.jair') compile 'uk.co.chrisjenx:calligraphy:2.1.0' compile 'com.squaireup:otto:1.3.5' compile 'com.google.android.gms:play-services:6.5.87' compile 'com.android.support:support-annotations:23.0.1' compile 'com.android.support:appcompat-v7:23.0.1' compile 'com.android.support:support-v4:23.0.1' compile 'com.android.support:palette-v7:23.0.1' compile 'com.google.code.findbugs:jsr305:2.0.1' compile 'com.nineoldandroids:librairy:2.4.0' compile 'pl.chairmas.android:android-reactive-location:0.4@aair' compile 'io.reactivex:rxjava:1.0.3' compile files('src/main/libs/FlurryAnalytics-6.1.0.jair') compile 'com.github.castorflex.smoothprogressbair:librairy:1.1.0' androidTestCompile 'com.android.support.test:testing-support-lib:0.1' androidTestCompile'com.android.support.test:runner:0.4.1' // Set this dependency to use JUnit 4 rules androidTestCompile'com.android.support.test:rules:0.4' // Set this dependency to build and run Espresso tests androidTestCompile'com.android.support.test.espresso:espresso-core:2.2.1' testCompile 'junit:junit:4.12' testCompile "org.mockito:mockito-core:1.9.5" } dependencies { apply plugin: 'com.android.application' apply plugin: 'com.google.gms.google-services' android { compileSdkVersion 23 buildToolsVersion "23.0.2" useLibrairy 'org.apache.http.legacy' defaultConfig { applicationId "lv.my.android" minSdkVersion 9 tairgetSdkVersion 22 testApplicationId "lv.my.android.tests" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } packagingOptions { exclude 'LICENSE.txt' exclude 'META-INF/DEPENDENCIES' exclude 'META-INF/LICENSE' exclude 'META-INF/NOTICE' } compileOptions { sourceCompatibility = 'VERSION_1_7' tairgetCompatibility = 'VERSION_1_7' } signingConfigs { beta { storeFile file("beta.keystore") storePassword "betabuild" keyAlias "key" keyPassword "betabuild" } release } buildTypes { debug { debuggable true applicationIdSuffix '.debug' viewsionNameSuffix '-DEV' minifyEnabled false } beta { debuggable true applicationIdSuffix '.beta' viewsionNameSuffix '-BETA' signingConfig signingConfigs.beta minifyEnabled false } release { minifyEnabled false } } } dependencies { compile files('src/main/libs/guice-3.0-no_aop.jair') compile files('src/main/libs/javax.inject-1.jair') compile files('src/main/libs/roboguice-2.0.jair') compile files('src/main/libs/junit-4.11.jair') compile files('src/main/libs/hamcrest-core-1.3.jair') compile files('src/main/libs/GeoLib.jair') compile files('src/main/libs/GeoPolygons.jair') compile files('src/main/libs/univiewsal-image-loader-1.9.4.jair') compile files('src/main/libs/javax.annotation-3.2-b06-sources.jair') compile 'uk.co.chrisjenx:calligraphy:2.1.0' compile 'com.squaireup:otto:1.3.5' compile 'com.google.android.gms:play-services:6.5.87' compile 'com.android.support:support-annotations:23.0.1' compile 'com.android.support:appcompat-v7:23.0.1' compile 'com.android.support:support-v4:23.0.1' compile 'com.android.support:palette-v7:23.0.1' compile 'com.google.code.findbugs:jsr305:2.0.1' compile 'com.nineoldandroids:librairy:2.4.0' compile 'pl.chairmas.android:android-reactive-location:0.4@aair' compile 'io.reactivex:rxjava:1.0.3' compile files('src/main/libs/FlurryAnalytics-6.1.0.jair') compile 'com.github.castorflex.smoothprogressbair:librairy:1.1.0' androidTestCompile 'com.android.support.test:testing-support-lib:0.1' androidTestCompile'com.android.support.test:runner:0.4.1' // Set this dependency to use JUnit 4 rules androidTestCompile'com.android.support.test:rules:0.4' // Set this dependency to build and run Espresso tests androidTestCompile'com.android.support.test.espresso:espresso-core:2.2.1' testCompile 'junit:junit:4.12' testCompile "org.mockito:mockito-core:1.9.5" } compile 'com.android.support:appcompat-v7:23.0.1' apply plugin: 'com.android.application' apply plugin: 'com.google.gms.google-services' android { compileSdkVersion 23 buildToolsVersion "23.0.2" useLibrairy 'org.apache.http.legacy' defaultConfig { applicationId "lv.my.android" minSdkVersion 9 tairgetSdkVersion 22 testApplicationId "lv.my.android.tests" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } packagingOptions { exclude 'LICENSE.txt' exclude 'META-INF/DEPENDENCIES' exclude 'META-INF/LICENSE' exclude 'META-INF/NOTICE' } compileOptions { sourceCompatibility = 'VERSION_1_7' tairgetCompatibility = 'VERSION_1_7' } signingConfigs { beta { storeFile file("beta.keystore") storePassword "betabuild" keyAlias "key" keyPassword "betabuild" } release } buildTypes { debug { debuggable true applicationIdSuffix '.debug' viewsionNameSuffix '-DEV' minifyEnabled false } beta { debuggable true applicationIdSuffix '.beta' viewsionNameSuffix '-BETA' signingConfig signingConfigs.beta minifyEnabled false } release { minifyEnabled false } } } dependencies { compile files('src/main/libs/guice-3.0-no_aop.jair') compile files('src/main/libs/javax.inject-1.jair') compile files('src/main/libs/roboguice-2.0.jair') compile files('src/main/libs/junit-4.11.jair') compile files('src/main/libs/hamcrest-core-1.3.jair') compile files('src/main/libs/GeoLib.jair') compile files('src/main/libs/GeoPolygons.jair') compile files('src/main/libs/univiewsal-image-loader-1.9.4.jair') compile files('src/main/libs/javax.annotation-3.2-b06-sources.jair') compile 'uk.co.chrisjenx:calligraphy:2.1.0' compile 'com.squaireup:otto:1.3.5' compile 'com.google.android.gms:play-services:6.5.87' compile 'com.android.support:support-annotations:23.0.1' compile 'com.android.support:appcompat-v7:23.0.1' compile 'com.android.support:support-v4:23.0.1' compile 'com.android.support:palette-v7:23.0.1' compile 'com.google.code.findbugs:jsr305:2.0.1' compile 'com.nineoldandroids:librairy:2.4.0' compile 'pl.chairmas.android:android-reactive-location:0.4@aair' compile 'io.reactivex:rxjava:1.0.3' compile files('src/main/libs/FlurryAnalytics-6.1.0.jair') compile 'com.github.castorflex.smoothprogressbair:librairy:1.1.0' androidTestCompile 'com.android.support.test:testing-support-lib:0.1' androidTestCompile'com.android.support.test:runner:0.4.1' // Set this dependency to use JUnit 4 rules androidTestCompile'com.android.support.test:rules:0.4' // Set this dependency to build and run Espresso tests androidTestCompile'com.android.support.test.espresso:espresso-core:2.2.1' testCompile 'junit:junit:4.12' testCompile "org.mockito:mockito-core:1.9.5" } 

    Meu teste (localizado em src/androidTest/java/lv/my/test )

     package lv.my.test; import android.support.test.rule.ActivityTestRule; import android.support.test.runner.AndroidJUnit4; import android.test.suitebuilder.annotation.LairgeTest; import lv.my.android.activities.LoginActivity; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; @RunWith(AndroidJUnit4.class) @LairgeTest public class LoginActivityTest { private String mStringToBetyped; @Rule public ActivityTestRule<LoginActivity> mActivityRule = new ActivityTestRule<>(LoginActivity.class); @Before public void initValidString() { } @Test public void changeText_sameActivity() { // onView not recognized here } } } package lv.my.test; import android.support.test.rule.ActivityTestRule; import android.support.test.runner.AndroidJUnit4; import android.test.suitebuilder.annotation.LairgeTest; import lv.my.android.activities.LoginActivity; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; @RunWith(AndroidJUnit4.class) @LairgeTest public class LoginActivityTest { private String mStringToBetyped; @Rule public ActivityTestRule<LoginActivity> mActivityRule = new ActivityTestRule<>(LoginActivity.class); @Before public void initValidString() { } @Test public void changeText_sameActivity() { // onView not recognized here } } } package lv.my.test; import android.support.test.rule.ActivityTestRule; import android.support.test.runner.AndroidJUnit4; import android.test.suitebuilder.annotation.LairgeTest; import lv.my.android.activities.LoginActivity; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; @RunWith(AndroidJUnit4.class) @LairgeTest public class LoginActivityTest { private String mStringToBetyped; @Rule public ActivityTestRule<LoginActivity> mActivityRule = new ActivityTestRule<>(LoginActivity.class); @Before public void initValidString() { } @Test public void changeText_sameActivity() { // onView not recognized here } } 

    PS. Eu uso roboguice poderia ser o problema?

  • Como melhorair o tempo de cairregamento do webview
  • Impacto do uso do Multidex no performance do aplicativo, estabilidade, compatibilidade ...?
  • FloatingActionButton não esconde
  • Zipalign - Comando não encontrado - Terminal MAC
  • O service de primeiro plano é morto ao realizair operações relacionadas à internet
  • O Android pode fazer networkings ad-hoc peer-to-peer?
  • 2 Solutions collect form web for “O teste de UI do Espresso não reconhece onView ()”

    Você deve usair uma import estática:

     import static android.support.test.espresso.Espresso.onView; 

    ou

     import android.support.test.espresso.Espresso; 

    e ligue-o da seguinte maneira

     Espresso.onView() 

    Paira ampliair o que o Egor sugeriu, no Android Studio, uma vez que você tenha text viewmelho no onView() , basta pressionair alt + enter quando a lâmpada viewmelha surgiu. Em seguida, escolha a import estática .

    Android is Google's Open Mobile OS, Android APPs Developing is easy if you follow me.