2014-12-03 115 views
1

我跟着this link建立測試用例Android Studio中:「的命令行是太長」,在dexDebugTest生成任務錯誤

但是,如果我試圖在我的項目運行一些測試,我得到以下錯誤:

**Execution failed for task ':common_lib_app:dexDebugTest'.** 
> com.android.ide.common.internal.LoggedErrorException: Failed to run command: 
    C:\Program Files (x86)\Android\android_studio\sdk\build-tools\19.1.0\dx.bat --dex --num-threads=4 --output D:\Android\android_studio\ 

update error: 

The command line is too long. 

FAILED 

FAILURE: Build failed with an exception. 

* What went wrong: 
Execution failed for task ':commom_lib_app:dexDebugTest'. 
> com.android.ide.common.internal.LoggedErrorException: Failed to run command: 
    C:\Program Files (x86)\Android\android_studio\sdk\build-tools\19.1.0\dx.bat --dex --num-threads=4 --output D:\Android\android_studio\app\Delivery\25-11-14\app\commom_lib_app\build\intermediates\dex\test\debug D:\Android\android_studio\app\Delivery\25-11-14\app\commom_lib_app\build\intermediates\classes\test\debug D:\Android\android_studio\app\Delivery\25-11-14\app\commom_lib_app\build\intermediates\dependency-cache\test\debug D:\Android\android_studio\app\Delivery\25-11-14\app\commom_lib_app\build\intermediates\pre-dexed\test\debug\android-viewbadger-9d48585bb36d47b79a1e72c63063924a4680e127.jar D:\Android\android_studio\app\Delivery\25-11-14\app\commom_lib_app\build\intermediates\pre-dexed\test\debug\annotations-12.0-74efc7d81ba4e593d47bf812f81a6e79e66e3a94.jar D:\Android\android_studio\app\Delivery\25-11-14\app\commom_lib_app\intermediates\pre-dexed\test\debug\apktool-lib-1.4.4-3-e106601b170eeb66eba64dc7a8f7b456d516b9f3.jar D:\Android\android_studio\app\Delivery\25-11-14\app\commom_lib_app\build\intermediates\pre-dexed\test\debug\bolts- 

我有一個共同的庫類(即== common_lib_app)的多個項目。

這裏是我的的build.gradle

androidTestCompile('junit:junit:4.11') { 
    exclude group: 'org.hamcrest', module: 'hamcrest-library' 
    } 
    androidTestCompile 'org.hamcrest:hamcrest-library:1.3' 
    androidTestCompile 'com.jayway.android.robotium:robotium-solo:5.2.1' 
    androidTestCompile 'org.mockito:mockito-core:1.9.5' 
    androidTestCompile 'com.google.dexmaker:dexmaker-mockito:1.0' 
    androidTestCompile 'com.google.dexmaker:dexmaker:1.0' 
    compile 'com.github.tony19:logback-android-core:1.1.1-2' 
    compile 'com.github.tony19:logback-android-classic:1.1.1-2' 
    compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.2' 
    compile 'com.squareup.okhttp:okhttp:1.5.4' 
    compile 'de.greenrobot:eventbus:2.2.1' 
    compile 'com.android.support:appcompat-v7:20.0.0' 
    compile 'com.android.support:gridlayout-v7:20.0.0' 
    compile 'com.android.support:support-v4:20.0.0' 
    compile 'com.commonsware.cwac:endless:1.2.3' 
    compile 'com.nhaarman.listviewanimations:library:2.6.0' 
} 

誰能幫我解決這個問題呢?

+0

您是否有異常的更多輸出?具體是什麼失敗? – 2014-12-03 14:22:09

+0

是讓我編輯在上面 – Manoj 2014-12-03 14:23:22

+0

我的問題,我已經更新了一些更多的錯誤u能PLZ看到它 – Manoj 2014-12-03 14:34:40

回答

1

這是錯誤https://code.google.com/p/android/issues/detail?id=75936(支持新型DX選項:--input列表=),它已被固定在Android Studio中的更高版本。我相信你正在運行一箇舊版本;現代版本不允許您使用Build Tools 19.1.0。嘗試更新Android Studio,按照其指示更新您的構建腳本以使用最新版本的Android Gradle插件,然後查看是否可以解決您的問題。

+0

是讓我們試試看,並知道你 – Manoj 2014-12-04 06:00:03

+0

@Manoj你試過更新構建工具,等級插件和android studio? – 2014-12-04 07:23:22

+0

是的,它讓我發現你正在使用最新的beta版的消息,但它不是最新版本的PLZ看看這個:HTTP://stackoverflow.com/questions/27288367/how-to-update-android-studio-beta-通道 – Manoj 2014-12-04 07:47:17