Loading docs/html/tools/building/multidex.jd +18 −8 Original line number Original line Diff line number Diff line Loading @@ -415,30 +415,40 @@ dependencies { <h2 id="testing">Testing Multidex Apps</h2> <h2 id="testing">Testing Multidex Apps</h2> <p> <p> Testing apps that use multidex configuration require some additional steps and configuration. When using instrumentation tests with multidex apps, additional configuration is required to Since the location of code for classes is not within a single DEX file, instrumentation tests do enable the test instrumentation. Because the location of code for classes in multidex apps is not not run properly unless configured for multidex. within a single DEX file, instrumentation tests do not run properly unless configured for multidex. </p> </p> <p> <p> When testing a multidex app with instrumentation tests, use To test a multidex app with instrumentation tests, configure the <a href="{@docRoot}reference/com/android/test/runner/MultiDexTestRunner.html"> <a href="{@docRoot}reference/com/android/test/runner/MultiDexTestRunner.html"> MultiDexTestRunner</a> from the multidex testing support library. The following sample MultiDexTestRunner</a> from the multidex testing support library. The following sample {@code build.gradle} file, demonstrates how to configure your build to use this test runner: {@code build.gradle} file demonstrates how to configure your build to use this test runner: </p> </p> <pre> <pre> android { android { defaultConfig { defaultConfig { ... ... testInstrumentationRunner "android.support.multidex.MultiDexTestRunner" testInstrumentationRunner "com.android.test.runner.MultiDexTestRunner" } } } } </pre> <p class="note"> <strong>Note:</strong> With Android Plugin for Gradle versions lower than 1.1, you need to add the following dependency for <code>multidex-instrumentation</code>: <pre> dependencies { dependencies { androidTestCompile 'com.android.support:multidex-instrumentation:1.0.0' androidTestCompile('com.android.support:multidex-instrumentation:1.0.1') { exclude group: 'com.android.support', module: 'multidex' } } } </pre> </pre> </p> <p> <p> You may use the instrumentation test runner class directly or extend it to fit your testing You may use the instrumentation test runner class directly or extend it to fit your testing Loading Loading
docs/html/tools/building/multidex.jd +18 −8 Original line number Original line Diff line number Diff line Loading @@ -415,30 +415,40 @@ dependencies { <h2 id="testing">Testing Multidex Apps</h2> <h2 id="testing">Testing Multidex Apps</h2> <p> <p> Testing apps that use multidex configuration require some additional steps and configuration. When using instrumentation tests with multidex apps, additional configuration is required to Since the location of code for classes is not within a single DEX file, instrumentation tests do enable the test instrumentation. Because the location of code for classes in multidex apps is not not run properly unless configured for multidex. within a single DEX file, instrumentation tests do not run properly unless configured for multidex. </p> </p> <p> <p> When testing a multidex app with instrumentation tests, use To test a multidex app with instrumentation tests, configure the <a href="{@docRoot}reference/com/android/test/runner/MultiDexTestRunner.html"> <a href="{@docRoot}reference/com/android/test/runner/MultiDexTestRunner.html"> MultiDexTestRunner</a> from the multidex testing support library. The following sample MultiDexTestRunner</a> from the multidex testing support library. The following sample {@code build.gradle} file, demonstrates how to configure your build to use this test runner: {@code build.gradle} file demonstrates how to configure your build to use this test runner: </p> </p> <pre> <pre> android { android { defaultConfig { defaultConfig { ... ... testInstrumentationRunner "android.support.multidex.MultiDexTestRunner" testInstrumentationRunner "com.android.test.runner.MultiDexTestRunner" } } } } </pre> <p class="note"> <strong>Note:</strong> With Android Plugin for Gradle versions lower than 1.1, you need to add the following dependency for <code>multidex-instrumentation</code>: <pre> dependencies { dependencies { androidTestCompile 'com.android.support:multidex-instrumentation:1.0.0' androidTestCompile('com.android.support:multidex-instrumentation:1.0.1') { exclude group: 'com.android.support', module: 'multidex' } } } </pre> </pre> </p> <p> <p> You may use the instrumentation test runner class directly or extend it to fit your testing You may use the instrumentation test runner class directly or extend it to fit your testing Loading