Android &引用;“命令行太长”;dexDebugTest生成任务中出错

Android &引用;“命令行太长”;dexDebugTest生成任务中出错,android,unit-testing,android-studio,Android,Unit Testing,Android Studio,我随后在Android Studio中设置了测试用例: 但如果我尝试在项目中运行一些测试,则会出现以下错误: **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\s

我随后在Android Studio中设置了测试用例:

但如果我尝试在项目中运行一些测试,则会出现以下错误:

**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)

这是我的体格。格雷德尔

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

有人能帮我解决这个问题吗?

这是一个bug(支持新的dx选项:--input list=),它已在Android Studio的更高版本中修复。我相信你运行的是一个旧版本;现代版本不允许您使用构建工具19.1.0。尝试更新Android Studio,按照其说明更新您的构建脚本以使用最新版本的Android Gradle插件,看看这是否解决了您的问题。

您是否有更多的异常输出?具体是什么失败了?是的,让我在上面编辑我的问题。我已经更新了一些错误。请大家看一下。实际上,我在这里使用robotium,因为有多个项目使用公共库类。尝试更改最小和最大目标版本,但没有change@Manoj您是否尝试过更新构建工具,grade插件和android studio?是的,它向我显示消息,您正在使用最新的测试版,但它不是最新的版本。请看一下:现在我使用的是android studio 1.0 RC 4,但向我显示错误,因为找不到Gradle DSL方法:'UseOldManifestMerge()'我已将其删除并运行,现在它显示为找不到Gradle DSL方法:'apply()“怎么解决这个问题issue@ScottBarta现在我使用的是Android studio 1.0 RC 4,但显示错误为找不到Gradle DSL方法:“UseOldManifestMerge()”我已将其删除并运行,现在显示为找不到Gradle DSL方法:“apply()“怎么解决这个问题issue@AhmadAli Nasir Ali Nasir Ali Nasir现在我正在使用Android studio 1.0 RC 4,但显示的错误是找不到Gradle DSL方法:“UseOldManifestMerge()”我已将其删除并运行,现在显示的错误是找不到Gradle DSL方法:“apply()”如何解决此问题