Which means "specified for property" resDir "does not exist."

When I create my project. Gradle result does not work (I use data binding in some code)

Error: A problem was detected with the configuration of the task ': app: processDebugAndroidTestResources'. > The directory 'C: \ Users \ user \ Desktop \ "My project loaction" \ app \ build \ intermediates \ data-binding-layout-out \ androidTest \ debug' specified for the 'resDir' property does not exist.

I try to use many methods (for example: Gradle, installing Android stdio reset, disable instant start, make only an empty directory). but this method does not work for me. Any solution idea?

My env

Adnroid stuidio: ver 2.2.3

Gradle: ver 3.2 (use local)

Settings (build, run, deploy)

  • Compliance: All checkboxes are checked.
  • Instant start: disable
      buildscript {
         repositories {
             maven {url "https://plugins.gradle.org/m2/"}
         }

         dependencies {
             classpath "gradle.plugin.me.tatarka: gradle-retrolambda: 3.4.0"
         }
     }

     apply plugin: 'com.android.application'

     // Can lambda expression in android
     apply plugin: "me.tatarka.retrolambda"


     android {
         compileSdkVersion 23
         buildToolsVersion '23 .0.3 '

         defaultConfig {
             applicationId "My project package name"
             minSdkVersion 21
             versionCode 1
             versionName "1.0"
         }

         buildTypes {

             // This code block is adding app version at apk file
             applicationVariants.all {variant ->
                 variant.outputs.each {output ->
                     output.outputFile = new File (
                             output.outputFile.parent,
                             output.outputFile.name.replace (". apk", "- $ {variant.versionName} .apk"))
                 }
             }

             debug {
                 minifyEnabled false
                 shrinkResources false
                 proguardFiles getDefaultProguardFile ('proguard-android.txt'), 'proguard-rules.pro'
             }

             release {
                 minifyEnabled true
                 shrinkResources false
                 zipAlignEnabled true
                 debuggable false
                 proguardFiles getDefaultProguardFile ('proguard-android.txt'), 'proguard-rules.pro'
             }

         }

         compileOptions
                 {
                     encoding = 'windows-1251' // write your encoding here
                     sourceCompatibility JavaVersion.VERSION_1_8
                     targetCompatibility JavaVersion.VERSION_1_8
                 }

         dataBinding {
             enabled = true
         }
     }
     repositories {
         maven {url "https://jitpack.io"}
         maven {url "https://repo.eclipse.org/content/repositories/paho-releases/"}
     }
     dependencies {
         compile fileTree (include: ['* .jar'], dir: 'libs')
         "Library inclue"
     }

+6
source share
5 answers

Complete Android Studio Uninstall

I did not find any solution or did not work for me .

So, I delete the entire resource of the Android studio, referring to the top link. And reinstalling android studio does not contain SDK. (SDK is installed manually)

0
source

I fixed this problem by deleting the .gradle / directory in the project directory and releasing the new assembly.

+4
source

Removing the build/ directory at the root of my project, and the build/ directory of all my modules resolved it.

+1
source

Delete root .build and .idea directories. Make a project again solved this problem. However, it took me 24 minutes to build the project.

+1
source

It seems to be fixed in Studio 2.3 Beta 1 .

In my specific scenario calling ./gradlew :app:installDebug once after switching flavors, the problem is temporarily fixed.

-one
source

Source: https://habr.com/ru/post/1013371/


All Articles