I'm using:

   - Android Studio 1.1.0 
   - Gradle 2.2.1 
   - Android Plugin for Gradle: 1.1.0

We have recently moved to Android Studio and we are trying to make our 
instrument test work. However when I run the test, it gives me error 

Running tests Test running startedTest running failed: Unable to find 
instrumentation info for: 
ComponentInfo{com.xxx.xxx.test/android.test.InstrumentationTestRunner} 
Empty test suite.

I am not sure what I am doing wrong here. Please see config below:

*Application class:*
public class XxxApp extends MultiDexApplication
{
...
}



apply plugin: 'com.android.application'

dependencies {
    ...
    androidTestCompile fileTree(dir: 'test-libs', include: '*.jar')
    androidTestCompile('com.android.support:multidex-instrumentation:1.0.1') {
        exclude group: 'com.android.support', module: 'multidex'
    }
    androidTestCompile 'com.google.dexmaker:dexmaker:1.+'
    androidTestCompile 'com.google.dexmaker:dexmaker-mockito:1.+'
    androidTestCompile 'junit:junit:4.11'
    androidTestCompile 'org.hamcrest:hamcrest-library:1.3'
    androidTestCompile 'org.mockito:mockito-core:1.9.5'}

android {
    compileSdkVersion 21
    buildToolsVersion "21.1.1"
    enforceUniquePackageName false
    dexOptions {
        javaMaxHeapSize "4g"
    }
    defaultConfig {

        minSdkVersion 14
        targetSdkVersion 21

        applicationId "com.xxx.xxx"
        multiDexEnabled true
        testInstrumentationRunner 'com.android.test.runner.MultiDexTestRunner'
        testApplicationId "com.xxx.xxx.test"
    }
    packagingOptions {
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
        exclude 'LICENSE.txt'
    }
    lintOptions {
        abortOnError false
        checkReleaseBuilds false
    }
    sourceSets {
        main {
            ...
        }

        // I have test under tests/src so mapped those 
        androidTest.setRoot('tests')
        androidTest.java.srcDir('tests/src')
        androidTest.res.srcDir('tests/res')
        androidTest.assets.srcDirs('tests/assets')

      ...}
*Test class*
public class XxxTests extends InstrumentationTestCase { public void testXxx() { 
... } }



*Top level build.gradle*
dependencies { classpath 'com.android.tools.build:gradle:1.1.0+' }

Originally posted at : 
http://stackoverflow.com/questions/29024667/running-instrumentation-test-for-multidexapplication-gives-error-unable-to-find

P.S. If thats not appropiate forum for this question, please guide me!

Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"adt-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to