Android 当I';m添加测试支持库

Android 当I';m添加测试支持库,android,android-studio,Android,Android Studio,我想在我的android应用程序中使用JUnit4框架,因此我添加了测试支持库,现在我的项目正在运行。以下是堆栈跟踪: Error:Execution failed for task ':app:packageDebug'. > Duplicate files copied in APK LICENSE.txt File 1: C:\Users\Damian\.gradle\caches\modules-2\files-2.1\junit\junit-dep\4.10\64417b3baf

我想在我的android应用程序中使用JUnit4框架,因此我添加了测试支持库,现在我的项目正在运行。以下是堆栈跟踪:

Error:Execution failed for task ':app:packageDebug'.
> Duplicate files copied in APK LICENSE.txt
File 1: C:\Users\Damian\.gradle\caches\modules-2\files-2.1\junit\junit-dep\4.10\64417b3bafdecd366afa514bd5beeae6c1f85ece\junit-dep-4.10.jar
File 2: C:\Users\Damian\.gradle\caches\modules-2\files-2.1\junit\junit-dep\4.10\64417b3bafdecd366afa514bd5beeae6c1f85ece\junit-dep-4.10.jar
这是我的build.gradle文件:

android {
compileSdkVersion 22
buildToolsVersion "21.1.2"

defaultConfig {
    applicationId "project.myapp.damian.myapp"
    minSdkVersion 14
    targetSdkVersion 22
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.0.0'

compile 'com.android.support.test:testing-support-lib:0.1'
compile 'com.android.support.test.espresso:espresso-core:2.0'
compile 'com.android.support.test.uiautomator:uiautomator-v18:2.0.0'
}

并阅读有关忽略许可证文件的错误消息。 从android studio粘贴

您可以忽略build.gradle中的这些文件: 安卓{ 包装选项{ 排除“LICENSE.txt” } }