2016-01-31 36 views
0

我想運行一個簡單的咖啡測試,它與錯誤訊息Android的咖啡測試失敗,地塞米松對於調試Android的測試

Error:Execution failed for task ':app:transformClassesWithDexForDebugAndroidTest'. 
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.7.0_79\bin\java.exe'' finished with non-zero exit value 2 

我都談到了很多我的gradle這個依賴的失敗。這是導致失敗的測試。主要的應用程序可以運行,但不是測試

@RunWith(AndroidJUnit4.class) 
@LargeTest 
public class ScheduleActivityTest { 
    @Rule 
    public final ActivityTestRule<ScheduleActivity> schedule = new ActivityTestRule<>(ScheduleActivity.class); 

    @Test 
    public void shouldBeVisible() throws Exception { 
     onView(withId(R.layout.activity_schedule)) 
       .check((ViewAssertion) isDisplayed()); 

    } 
} 

這裏是我的gradle這個文件

apply plugin: 'com.android.application' 
apply plugin: 'com.neenbedankt.android-apt' 

android { 
    compileSdkVersion 23 
    buildToolsVersion "23.0.2" 

    defaultConfig { 
     applicationId "com.okason.prontosalon" 
     minSdkVersion 16 
     targetSdkVersion 23 
     versionCode 1 
     versionName "1.0" 

     testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
    } 

    dependencies { 

    compile 'com.android.support:support-annotations:23.1.1' 

    compile fileTree(dir: 'libs', include: ['*.jar']) 
    compile('com.mikepenz:materialdrawer:[email protected]') { 
     transitive = true 
    } 
    compile 'com.android.support:appcompat-v7:23.1.1' 
    compile 'com.android.support:design:23.1.1' 

    compile 'com.squareup:otto:1.3.8' 
    compile 'com.squareup.picasso:picasso:2.5.2' 
    compile 'com.jakewharton:butterknife:7.0.1' 
    compile 'de.hdodenhof:circleimageview:2.0.0' 
    compile 'com.mikepenz:fontawesome-typeface:[email protected]' 

    androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.1' 
    androidTestCompile 'com.android.support.test:runner:0.4.1' 
    androidTestCompile 'com.android.support.test:rules:0.4.1' 
    androidTestCompile 'com.android.support:support-annotations:23.1.1' 
    androidTestCompile 'com.android.support.test:testing-support-lib:0.1' 


} 

什麼可能我是做錯了什麼?這裏是我的項目結構

enter image description here

回答

0

你能嘗試加入dexOptions到您的應用程序/的build.gradle。

dexOptions { 
    jumboMode = true 
}