From 7a4210768717fb6335645ca095f00c9c05d21375 Mon Sep 17 00:00:00 2001 From: Rich Slogar Date: Wed, 15 Apr 2015 16:51:18 -0700 Subject: docs: gradle multidex update b.andriod 103259 b.android 165146 Change-Id: If5107aa419b9eb097249141460d0dd8673dce240 --- docs/html/tools/building/multidex.jd | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/docs/html/tools/building/multidex.jd b/docs/html/tools/building/multidex.jd index 49cde8c..e441a7c 100644 --- a/docs/html/tools/building/multidex.jd +++ b/docs/html/tools/building/multidex.jd @@ -415,30 +415,40 @@ dependencies {

Testing Multidex Apps

- Testing apps that use multidex configuration require some additional steps and configuration. - Since the location of code for classes is not within a single DEX file, instrumentation tests do - not run properly unless configured for multidex. + When using instrumentation tests with multidex apps, additional configuration is required to + enable the test instrumentation. Because the location of code for classes in multidex apps is not + within a single DEX file, instrumentation tests do not run properly unless configured for + multidex.

- When testing a multidex app with instrumentation tests, use + To test a multidex app with instrumentation tests, configure the MultiDexTestRunner 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:

 android {
   defaultConfig {
       ...
-      testInstrumentationRunner "android.support.multidex.MultiDexTestRunner"
+      testInstrumentationRunner "com.android.test.runner.MultiDexTestRunner"
   }
 }
+
+

+ Note: With Android Plugin for Gradle versions lower than 1.1, you need to add + the following dependency for multidex-instrumentation: +

 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'
+    }       
 }
 
+

+

You may use the instrumentation test runner class directly or extend it to fit your testing @@ -455,4 +465,4 @@ public void onCreate(Bundle arguments) {

Note: Use of multidex for creating a test APK is not currently supported. -

\ No newline at end of file +

-- cgit v1.1