gpt4 book ai didi

java - "specified for property ' resDir' 不存在是什么意思。”

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:36:43 24 4
gpt4 key购买 nike

当我构建我的项目时。 Gradle 结果是 underblock(我在一些代码中使用数据绑定(bind))

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

我尝试了很多方法(例如:gradle 设置、Android stdio 设置重置、禁用即时运行、仅创建空目录)。但这种方法对我不起作用。有什么解决方案吗?

我的环境

Adnroid studio : ver 2.2.3

Gradle : ver 3.2 (使用本地)

设置(构建、执行、部署)

  • 编译器:选中所有 4 个复选框
  • 即时运行:禁用
     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"    }

最佳答案

我通过删除项目目录中的 .gradle/目录并启动新构建来解决此问题。

关于java - "specified for property ' resDir' 不存在是什么意思。”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41254303/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com