The problem is this: when creating an empty project, even without activating, one and the same errors occur, as in idea and AS.

Error:Error: Duplicate resources Error:Execution failed for task ':app:mergeDebugResources'. [style-ldltr-v21/Base.Widget.AppCompat.Spinner.Underlined] MyApplication244/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/25.1.1/res/values-ldltr-v21/values-ldltr-v21.xml [style-ldltr-v21/Base.Widget.AppCompat.Spinner.Underlined] MyApplication244/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/25.1.1/res/values-ldltr-v21/values-ldltr-v21.xml: Error: Duplicate resources 

build.gradle (app)

 apply plugin: 'com.android.application' android { compileSdkVersion 25 buildToolsVersion "25.0.2" defaultConfig { applicationId "com.example.inoob.myapplication244" minSdkVersion 19 targetSdkVersion 25 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 fileTree(dir: 'libs', include: ['*.jar']) androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { exclude group: 'com.android.support', module: 'support-annotations' }) compile 'com.android.support:appcompat-v7:25.1.1' testCompile 'junit:junit:4.12' compile 'com.android.support:design:25.1.1' } 

build.gradle (MyApplication244)

 // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:2.2.3' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } allprojects { repositories { jcenter() } } task clean(type: Delete) { delete rootProject.buildDir } 

I tried to put on previous versions of API 21, 22, 23, the result of the same Google did not save me MB I did not have the version of Google) click where to look please

  • show settings.gradle file - Andrew Grow
  • include ': app' that's all described there - Nikolay Morgunov
  • You probably do not need tests - remove them and the problem should disappear - Yuriy SPb

1 answer 1

You have duplication of dependencies. Most likely this is caused by the default test frameworks. There are two ways. Correct in your case (tests, I think, are not needed now) - remove dependencies with tests. Those. lines:

 testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { exclude group: 'com.android.support', module: 'support-annotations' }) testCompile 'junit:junit:4.12' 

Or remove specific modules from test dependencies:

 androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { exclude group: 'com.android.support', module: 'support-annotations' exclude group: 'com.android.support', module: 'appcompat-v7' exclude group: 'com.android.support', module: 'design' }) 
  • I tried both options. If you build a project with a graidl, the same errors again fly out. - Nikolay Morgunov
  • @ Nikolay Morgunov, the first method really did not help? Have you exactly deleted everything? Did you try to build / clean? - Yuriy SPb
  • Yes, I did not help 5 times I tried clean / build - Nikolay Morgunov
  • @ Nikolay Morgunov, and you didn’t add anything at all or change the project? And restarting the studio does not help? - Yuriy SPb
  • and restarting does not help either, but is there any way to disable tests in the very grade itself? I mean from the project construction cycle - Nikolay Morgunov