Javier Sivianes
Javier Sivianes

Reputation: 792

Cannot resolve type com.google.android.apps. while editing Debug Configurations

I am trying to configure Instrumental Tests with Espresso in my android app, following this question because there was a null pointer exception when running the test.

Actually my build.gradle dependencies section looks like this:

dependencies {
    compile files('libs/pixlui-1-0-5.jar')
    // You must install or update the Support Repository through the SDK manager to use this dependency.
    compile('com.fortysevendeg.swipelistview:swipelistview:1.0-SNAPSHOT@aar') {
        transitive = true
    }
    //compile 'com.google.code.gson:gson:2.2.4'
    compile 'com.google.code.gson:gson:2.3'
    compile 'com.android.support:appcompat-v7:20.+'
    compile 'com.google.android.gms:play-services-maps:7.3.0'
    compile 'com.google.android.gms:play-services-location:7.3.0'
    compile 'com.google.android.gms:play-services-gcm:7.3.0'

    compile 'com.loopj.android:android-async-http:1.4.5'
    // You must install or update the Support Repository through the SDK manager to use this dependency.
    compile 'com.android.support:support-v4:20.+'
    compile ('ch.acra:acra:4.5.0'){
        exclude group: 'org.json'
    }
    compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.2'
    compile 'com.squareup.picasso:picasso:2.3.4'
    provided 'com.squareup.dagger:dagger-compiler:1.2.+'
    compile 'com.squareup.dagger:dagger:1.2.+'
    compile 'com.google.guava:guava:15.0'
    //compile 'com.facebook.android:facebook-android-sdk:3.23.0'
    compile 'com.mixpanel.android:mixpanel-android:4.5.3'
    compile 'com.google.maps.android:android-maps-utils:0.3+'

    // Testing dependencies
    testCompile "junit:junit:4.5+"
    testCompile "org.mockito:mockito-core:1.9.5"

    androidTestCompile 'com.android.support.test.espresso:espresso-core:2.0'
    androidTestCompile 'com.android.support.test:testing-support-lib:0.1'
    androidTestCompile ('com.android.support.test.espresso:espresso-contrib:2.0') {
        exclude module: 'support-annotations'
    }
}

And defaultConfig section:

defaultConfig {
        applicationId 'com.blabla.easyaccess'
        minSdkVersion 14
        targetSdkVersion 19
        testInstrumentationRunner "com.google.android.apps.common.testing.testrunner.GoogleInstrumentationTestRunner"

    }

I read I don't need to modify android.manifest because is it auto generated for IntrumentalTests.

But when I edit debug configuration "com.google.android.apps.common.testing.testrunner.GoogleInstrumentationTestRunner" cannot be resolved.

Edit Configuration

What am I missing?

Upvotes: 0

Views: 174

Answers (1)

Be_Negative
Be_Negative

Reputation: 4972

Starting from Espresso 2.0 you need to use android.support.test.runner.AndroidJUnitRunner as you default runner

Setup instructions can be found here

Upvotes: 0

Related Questions