gpt4 book ai didi

java - 在TeamCity上使用Gradle构建时失败:任务:app:processDebugResources失败

转载 作者:行者123 更新时间:2023-12-03 05:25:24 25 4
gpt4 key购买 nike

我通过Gradle Builder在命令行中构建Android项目:

Gradlew build

一切正常:
BUILD SUCCESSFUL in 4s
54 actionable tasks: 1 executed, 53 up-to-date

但是在相同的项目,相同的环境中,在TeamCity中构建时会出错:
Execution failed for task ':app:processDebugResources'. org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all files for configuration ':app:debugRuntimeClasspath'.'

找不到很多这样的 Artifact :
What went wrong:
[org.gradle.internal.buildevents.BuildExceptionReporter] Execution failed for task ':app:processDebugResources'.
[org.gradle.internal.buildevents.BuildExceptionReporter] > Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
[org.gradle.internal.buildevents.BuildExceptionReporter] > Failed to transform artifact 'appcompat.aar (androidx.appcompat:appcompat:1.1.0)' to match attributes {artifactType=android-compiled-dependencies-resources}.
[org.gradle.internal.buildevents.BuildExceptionReporter] > Execution failed for AarResourcesCompilerTransform: C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-2\files-2.1\f7fa931c10060cb31b4ececcd856b65d\appcompat-1.1.0.
[org.gradle.internal.buildevents.BuildExceptionReporter] > Android resource compilation failed
[org.gradle.internal.buildevents.BuildExceptionReporter] AAPT: C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-2\files-2.1\7340c553bf3aabb8e86abd5cba76d4e6\androidx.appcompat: error: The system cannot find the file specified. (2).

我尝试运行 clean buildbuild命令,但是它不起作用。

我也将一行添加到Gradle.properties中以关闭gradle守护进程:
add org.gradle.daemon=false

gradle-wrapper.properties:
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip

Build.gradle:
dependencies {
classpath 'com.android.tools.build:gradle:3.6.1

可能是因为该项目位于GitHub上的远程位置并且需要其他脚本吗?
enter image description here

最佳答案

我遇到了类似的问题,并通过在Teamcity项目中添加以下参数解决了该问题。
环境变量
JAVA_HOME-本地计算机上Java JDK的路径
D:\ Android Studio \ jre
ANDROID_HOME-您本地计算机上Android SDK的路径
C:\ Users \ kelvin \ AppData \ Local \ Android \ Sdk

关于java - 在TeamCity上使用Gradle构建时失败:任务:app:processDebugResources失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61449092/

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