小编Igo*_*gis的帖子

Android IllegalStateException没有注册的工具!必须在注册仪器下运行

我正在努力使用Espresso在Android上进行功能测试.我的应用程序是一个Multdex应用程序,所以我按照以下链接写的说明如下:(https://developer.android.com/tools/building/multidex.html).

我已经像这样配置了我的build.gradle:

apply plugin: 'com.android.application'
apply plugin: 'android-apt'
def AAVersion = '3.3.2'

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4'
    }
}
    apt {
        arguments {
            androidManifestFile variant.outputs[0].processResources.manifestFile
            resourcePackageName 'br.com.foo'
        }
    }

    android {
        compileSdkVersion 21
        buildToolsVersion "21.1.2"
        defaultConfig {
            applicationId "br.com.foo"
            minSdkVersion 15
            targetSdkVersion 21
            android.enforceUniquePackageName = false
            multiDexEnabled true
            compileOptions {
                sourceCompatibility JavaVersion.VERSION_1_7
                targetCompatibility JavaVersion.VERSION_1_7
            }

            testApplicationId "br.com.foo.test"
            testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
            testInstrumentationRunner "com.android.test.runner.MultiDexTestRunner"
        }

        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
            }
        } …
Run Code Online (Sandbox Code Playgroud)

android functional-testing android-studio android-espresso

21
推荐指数
2
解决办法
2万
查看次数