Tag Archives: gradle error

How to Solve Gradle Error: Plugin with id ‘jetty’ not found.

In a web project, jetty is used. When building the project with gradle, I found the prompt Plugin with id’jetty’ not found. That is, the plug-in could not be found.

The Groovy code is as follows:

apply plugin: 'java'
apply plugin: 'war'
apply plugin: 'jetty'
 
repositories {
	mavenCentral()
}
 
dependencies {
	providedCompile 'javax.servlet:servlet-api:2.5',
					'javax.servlet.jsp:jsp-api:2.1'
	runtime 'javax.servlet:jstl:1.1.2',
			'taglibs:standard:1.1.2'
}

The prompt is as follows

FAILURE: Build failed with an exception.

* Where:
Build file ‘H:\gradleCode\test\build.gradle’ line: 3

* What went wrong:
A problem occurred evaluating root project ‘test’.
> Plugin with id ‘jetty’ not found.

* Try:
Run with –stacktrace option to get the stack trace. Run with –info or –debug option
to get more log output. Run with –scan to get full insights.

* Get more help at https://help.gradle.org

I went to the official website and found a post https://discuss.gradle.org/t/gradle2-still-cant-specify-jetty-version/5069

It is said that jetty cannot specify a specific version in Gradle 1.x, but my hint is that this plug-in is not found at all, I am very confused. . . .

Someone in the post said that I recommend a third-party library gretty. I tried it and it succeeded.

If you are using Gradle version 2.1 or higher, just these few lines of code will do.

plugins {
  id "org.akhikhl.gretty" version "2.0.0"
}

Otherwise, write a few more lines:

buildscript {
  repositories {
    maven {
      url "https://plugins.gradle.org/m2/"
    }
  }
  dependencies {
    classpath "gradle.plugin.org.akhikhl.gretty:gretty:2.0.0"
  }
}
 
apply plugin: "org.akhikhl.gretty"

This is my build.gradle:

apply plugin: 'java'
apply plugin: 'war'
buildscript {
  repositories {
    maven {
      url "https://plugins.gradle.org/m2/"
    }
  }
  dependencies {
    classpath "gradle.plugin.org.akhikhl.gretty:gretty:2.0.0"
  }
}
 
apply plugin: "org.akhikhl.gretty"
repositories {
	jcenter()
}
 
dependencies {
	providedCompile 'javax.servlet:servlet-api:2.5',
					'javax.servlet.jsp:jsp-api:2.1'
	runtime 'javax.servlet:jstl:1.1.2',
			'taglibs:standard:1.1.2'
}

The results of the operation are as follows:

gradle build

 

Download https://plugins.gradle.org/m2/gradle/plugin/org/akhikhl/gretty/gretty/2.0.0/gr
etty-2.0.0.pom
Download https://plugins.gradle.org/m2/org/akhikhl/gretty/gretty-core/2.0.0/gretty-core
-2.0.0.pom
Download https://plugins.gradle.org/m2/org/eclipse/jetty/jetty-util/8.1.8.v20121106/jet
ty-util-8.1.8.v20121106.pom
Download https://plugins.gradle.org/m2/org/eclipse/jetty/jetty-project/8.1.8.v20121106/
jetty-project-8.1.8.v20121106.pom
Download https://plugins.gradle.org/m2/org/springframework/boot/spring-boot-loader-tool
s/1.5.4.RELEASE/spring-boot-loader-tools-1.5.4.RELEASE.pom
Download https://plugins.gradle.org/m2/org/eclipse/jetty/jetty-parent/20/jetty-parent-2
0.pom
Download https://plugins.gradle.org/m2/org/springframework/boot/spring-boot-tools/1.5.4
.RELEASE/spring-boot-tools-1.5.4.RELEASE.pom
Download https://plugins.gradle.org/m2/org/springframework/boot/spring-boot-parent/1.5.
4.RELEASE/spring-boot-parent-1.5.4.RELEASE.pom
Download https://plugins.gradle.org/m2/org/springframework/boot/spring-boot-dependencie
s/1.5.4.RELEASE/spring-boot-dependencies-1.5.4.RELEASE.pom
Download https://plugins.gradle.org/m2/com/fasterxml/jackson/jackson-bom/2.8.8/jackson-
bom-2.8.8.pom
Download https://plugins.gradle.org/m2/com/fasterxml/jackson/jackson-parent/2.8/jackson
-parent-2.8.pom
Download https://plugins.gradle.org/m2/com/fasterxml/oss-parent/27/oss-parent-27.pom
Download https://plugins.gradle.org/m2/org/apache/logging/log4j/log4j-bom/2.7/log4j-bom
-2.7.pom
Download https://plugins.gradle.org/m2/org/springframework/spring-framework-bom/4.3.9.R
ELEASE/spring-framework-bom-4.3.9.RELEASE.pom
Download https://plugins.gradle.org/m2/org/springframework/data/spring-data-releasetrai
n/Ingalls-SR4/spring-data-releasetrain-Ingalls-SR4.pom
Download https://plugins.gradle.org/m2/org/springframework/data/build/spring-data-build
/1.9.4.RELEASE/spring-data-build-1.9.4.RELEASE.pom
Download https://plugins.gradle.org/m2/org/springframework/integration/spring-integrati
on-bom/4.3.10.RELEASE/spring-integration-bom-4.3.10.RELEASE.pom
Download https://plugins.gradle.org/m2/org/springframework/security/spring-security-bom
/4.2.3.RELEASE/spring-security-bom-4.2.3.RELEASE.pom
Download https://plugins.gradle.org/m2/org/codehaus/groovy/groovy/2.4.11/groovy-2.4.11.
pom
Download https://plugins.gradle.org/m2/org/codehaus/groovy/groovy-json/2.4.11/groovy-js
on-2.4.11.pom
Download https://plugins.gradle.org/m2/commons-cli/commons-cli/1.2/commons-cli-1.2.pom
Download https://plugins.gradle.org/m2/commons-configuration/commons-configuration/1.10
/commons-configuration-1.10.pom
Download https://plugins.gradle.org/m2/org/apache/commons/commons-parent/11/commons-par
ent-11.pom
Download https://plugins.gradle.org/m2/org/apache/commons/commons-lang3/3.3.2/commons-l
ang3-3.3.2.pom
Download https://plugins.gradle.org/m2/org/apache/servicemix/bundles/org.apache.service
mix.bundles.bcprov-jdk16/1.46_3/org.apache.servicemix.bundles.bcprov-jdk16-1.46_3.pom
Download https://plugins.gradle.org/m2/org/apache/commons/commons-parent/32/commons-par
ent-32.pom
Download https://plugins.gradle.org/m2/org/apache/commons/commons-parent/33/commons-par
ent-33.pom
Download https://plugins.gradle.org/m2/org/apache/servicemix/bundles/bundles-pom/8/bund
les-pom-8.pom
Download https://plugins.gradle.org/m2/org/apache/apache/13/apache-13.pom
Download https://plugins.gradle.org/m2/org/apache/servicemix/servicemix-pom/5/servicemi
x-pom-5.pom
Download https://plugins.gradle.org/m2/org/apache/apache/4/apache-4.pom
Download https://plugins.gradle.org/m2/commons-io/commons-io/2.4/commons-io-2.4.pom
Download https://plugins.gradle.org/m2/org/apache/apache/7/apache-7.pom
Download https://plugins.gradle.org/m2/org/springframework/boot/spring-boot-devtools/1.
3.3.RELEASE/spring-boot-devtools-1.3.3.RELEASE.pom
Download https://plugins.gradle.org/m2/org/apache/commons/commons-parent/25/commons-par
ent-25.pom
Download https://plugins.gradle.org/m2/org/springframework/boot/spring-boot-parent/1.3.
3.RELEASE/spring-boot-parent-1.3.3.RELEASE.pom
Download https://plugins.gradle.org/m2/org/springframework/boot/spring-boot-dependencie
s/1.3.3.RELEASE/spring-boot-dependencies-1.3.3.RELEASE.pom
Download https://plugins.gradle.org/m2/org/springframework/spring-framework-bom/4.2.5.R
ELEASE/spring-framework-bom-4.2.5.RELEASE.pom
Download https://plugins.gradle.org/m2/org/springframework/data/spring-data-releasetrai
n/Gosling-SR4/spring-data-releasetrain-Gosling-SR4.pom
Download https://plugins.gradle.org/m2/org/springframework/data/build/spring-data-build
/1.7.4.RELEASE/spring-data-build-1.7.4.RELEASE.pom
Download https://plugins.gradle.org/m2/org/springframework/integration/spring-integrati
on-bom/4.2.5.RELEASE/spring-integration-bom-4.2.5.RELEASE.pom
Download https://plugins.gradle.org/m2/org/springframework/security/spring-security-bom
/4.0.3.RELEASE/spring-security-bom-4.0.3.RELEASE.pom
Download https://plugins.gradle.org/m2/org/springframework/spring-core/4.3.9.RELEASE/sp
ring-core-4.3.9.RELEASE.pom
Download https://plugins.gradle.org/m2/commons-lang/commons-lang/2.6/commons-lang-2.6.p
om
Download https://plugins.gradle.org/m2/commons-logging/commons-logging/1.1.1/commons-lo
gging-1.1.1.pom
Download https://plugins.gradle.org/m2/org/apache/commons/commons-parent/17/commons-par
ent-17.pom
Download https://plugins.gradle.org/m2/org/apache/commons/commons-parent/5/commons-pare
nt-5.pom
Download https://plugins.gradle.org/m2/org/springframework/boot/spring-boot-autoconfigu
re/1.3.3.RELEASE/spring-boot-autoconfigure-1.3.3.RELEASE.pom
Download https://plugins.gradle.org/m2/org/springframework/boot/spring-boot/1.3.3.RELEA
SE/spring-boot-1.3.3.RELEASE.pom
Download https://plugins.gradle.org/m2/org/springframework/spring-context/4.2.5.RELEASE
/spring-context-4.2.5.RELEASE.pom
Download https://plugins.gradle.org/m2/org/springframework/spring-expression/4.2.5.RELE
ASE/spring-expression-4.2.5.RELEASE.pom
Download https://plugins.gradle.org/m2/org/springframework/spring-aop/4.2.5.RELEASE/spr
ing-aop-4.2.5.RELEASE.pom
Download https://plugins.gradle.org/m2/org/springframework/spring-beans/4.2.5.RELEASE/s
pring-beans-4.2.5.RELEASE.pom
Download https://plugins.gradle.org/m2/aopalliance/aopalliance/1.0/aopalliance-1.0.pom
Download https://plugins.gradle.org/m2/commons-logging/commons-logging/1.2/commons-logg
ing-1.2.pom
Download https://plugins.gradle.org/m2/org/apache/commons/commons-parent/34/commons-par
ent-34.pom
Download https://plugins.gradle.org/m2/gradle/plugin/org/akhikhl/gretty/gretty/2.0.0/gr
etty-2.0.0.jar
Download https://plugins.gradle.org/m2/org/akhikhl/gretty/gretty-core/2.0.0/gretty-core
-2.0.0.jar
Download https://plugins.gradle.org/m2/org/springframework/boot/spring-boot-loader-tool
s/1.5.4.RELEASE/spring-boot-loader-tools-1.5.4.RELEASE.jar
Download https://plugins.gradle.org/m2/org/eclipse/jetty/jetty-util/8.1.8.v20121106/jet
ty-util-8.1.8.v20121106.jar
Download https://plugins.gradle.org/m2/org/codehaus/groovy/groovy/2.4.11/groovy-2.4.11.
jar
Download https://plugins.gradle.org/m2/commons-cli/commons-cli/1.2/commons-cli-1.2.jar
Download https://plugins.gradle.org/m2/commons-configuration/commons-configuration/1.10
/commons-configuration-1.10.jar
Download https://plugins.gradle.org/m2/commons-io/commons-io/2.4/commons-io-2.4.jar
Download https://plugins.gradle.org/m2/org/apache/commons/commons-lang3/3.3.2/commons-l
ang3-3.3.2.jar
Download https://plugins.gradle.org/m2/org/apache/servicemix/bundles/org.apache.service
mix.bundles.bcprov-jdk16/1.46_3/org.apache.servicemix.bundles.bcprov-jdk16-1.46_3.jar
Download https://plugins.gradle.org/m2/org/springframework/boot/spring-boot-autoconfigu
re/1.3.3.RELEASE/spring-boot-autoconfigure-1.3.3.RELEASE.jar
Download https://plugins.gradle.org/m2/org/springframework/boot/spring-boot-devtools/1.
3.3.RELEASE/spring-boot-devtools-1.3.3.RELEASE.jar
Download https://plugins.gradle.org/m2/org/springframework/spring-context/4.2.5.RELEASE
/spring-context-4.2.5.RELEASE.jar
Download https://plugins.gradle.org/m2/org/springframework/boot/spring-boot/1.3.3.RELEA
SE/spring-boot-1.3.3.RELEASE.jar
Download https://plugins.gradle.org/m2/org/springframework/spring-aop/4.2.5.RELEASE/spr
ing-aop-4.2.5.RELEASE.jar
Download https://plugins.gradle.org/m2/org/springframework/spring-beans/4.2.5.RELEASE/s
pring-beans-4.2.5.RELEASE.jar
Download https://plugins.gradle.org/m2/org/springframework/spring-expression/4.2.5.RELE
ASE/spring-expression-4.2.5.RELEASE.jar
Download https://plugins.gradle.org/m2/org/springframework/spring-core/4.3.9.RELEASE/sp
ring-core-4.3.9.RELEASE.jar
Download https://plugins.gradle.org/m2/commons-logging/commons-logging/1.2/commons-logg
ing-1.2.jar
Download https://plugins.gradle.org/m2/commons-lang/commons-lang/2.6/commons-lang-2.6.j
ar
Download https://plugins.gradle.org/m2/aopalliance/aopalliance/1.0/aopalliance-1.0.jar
Download https://plugins.gradle.org/m2/org/codehaus/groovy/groovy-json/2.4.11/groovy-js
on-2.4.11.jar
Download https://jcenter.bintray.com/javax/websocket/javax.websocket-api/1.0/javax.webs
ocket-api-1.0.pom
Download https://jcenter.bintray.com/javax/servlet/jsp/jsp-api/2.1/jsp-api-2.1.pom
Download https://jcenter.bintray.com/javax/servlet/servlet-api/2.5/servlet-api-2.5.pom
Download https://jcenter.bintray.com/javax/servlet/javax.servlet-api/3.1.0/javax.servle
t-api-3.1.0.pom
Download https://jcenter.bintray.com/javax/websocket/javax.websocket-all/1.0/javax.webs
ocket-all-1.0.pom
Download https://jcenter.bintray.com/net/java/jvnet-parent/3/jvnet-parent-3.pom
Download https://jcenter.bintray.com/net/java/jvnet-parent/4/jvnet-parent-4.pom
Download https://jcenter.bintray.com/javax/servlet/servlet-api/2.5/servlet-api-2.5.jar
Download https://jcenter.bintray.com/javax/websocket/javax.websocket-api/1.0/javax.webs
ocket-api-1.0.jar
Download https://jcenter.bintray.com/javax/servlet/jsp/jsp-api/2.1/jsp-api-2.1.jar
Download https://jcenter.bintray.com/javax/servlet/javax.servlet-api/3.1.0/javax.servle
t-api-3.1.0.jar
Download https://jcenter.bintray.com/javax/servlet/jstl/1.1.2/jstl-1.1.2.pom
Download https://jcenter.bintray.com/taglibs/standard/1.1.2/standard-1.1.2.pom
Download https://jcenter.bintray.com/javax/servlet/jstl/1.1.2/jstl-1.1.2.jar
Download https://jcenter.bintray.com/taglibs/standard/1.1.2/standard-1.1.2.jar
BUILD SUCCESSFUL in 1m 5s
2 actionable tasks: 2 executed

Failed to find target with hash string ‘android-25’ in:D:\SDK

error message

Failed to find target with hash string 'android-25' in:D:\SDK
Install missing platform(s) and sync project


watermark is so annoying!

没有找到与哈希字符串“android-25”匹配的目标在D:\ SDK。
安装丢失的平台并同步项目

appears in the scenario

got a nice project and opened it up locally. The above error occurred after compilation.

solution

problem error means: no information for Android API 25 was found in the SDK. Here’s why: You need Android API 25 in your project, but you haven’t downloaded it locally.

method 1
go to SDK Manager to download the corresponding API, and then re-compile it. In the new Version of Android Studio, click Ok or Apply below to confirm the download after selecting the corresponding API.

The pom file

gradle could not get

Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.1.4/gradle-3.1.4.pom'. Received status code 405 from server: Method Not Allowed
Enable Gradle 'offline mode' and sync project

configure maven address for domestic :

allprojects {
    repositories {
        google()
        jcenter()
        maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
    }
}

Android studio gradle cannot get the pom file

Failed to capture snapshot of output files for task ‘ :packagePreDebug’ property ”outputDirectory’

The

android studio project reported the following error:

project is so funny.

take a look at the screenshot:

then look at the log for gradle console:

log

Error:Internal error:
org.gradle.tooling.BuildException: Could not run build action using Gradle distribution 'https://services.gradle.org/distributions/gradle-4.8-all.zip'.
	at org.gradle.tooling.internal.consumer.ExceptionTransformer.transform(ExceptionTransformer.java:51)
	at org.gradle.tooling.internal.consumer.ExceptionTransformer.transform(ExceptionTransformer.java:29)
	at org.gradle.tooling.internal.consumer.ResultHandlerAdapter.onFailure(ResultHandlerAdapter.java:41)
	at org.gradle.tooling.internal.consumer.async.DefaultAsyncConsumerActionExecutor$1$1.run(DefaultAsyncConsumerActionExecutor.java:57)
	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
	at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:46)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
	at org.gradle.tooling.internal.consumer.BlockingResultHandler.getResult(BlockingResultHandler.java:46)
	at org.gradle.tooling.internal.consumer.DefaultBuildActionExecuter.run(DefaultBuildActionExecuter.java:60)
	at com.android.tools.idea.gradle.project.build.invoker.GradleTasksExecutorImpl.lambda$invokeGradleTasks$2(GradleTasksExecutorImpl.java:370)
	at org.jetbrains.plugins.gradle.service.execution.GradleExecutionHelper.execute(GradleExecutionHelper.java:218)
	at com.android.tools.idea.gradle.project.build.invoker.GradleTasksExecutorImpl.invokeGradleTasks(GradleTasksExecutorImpl.java:426)
	at com.android.tools.idea.gradle.project.build.invoker.GradleTasksExecutorImpl.run(GradleTasksExecutorImpl.java:209)
	at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:726)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$1(CoreProgressManager.java:176)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:556)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:501)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:66)
	at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:163)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl$1.run(ProgressManagerImpl.java:137)
	at com.intellij.openapi.application.impl.ApplicationImpl$2.run(ApplicationImpl.java:334)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
Caused by: org.gradle.internal.exceptions.LocationAwareException: Failed to capture snapshot of output files for task ':UserAppModule:packagePreDebug' property 'outputDirectory' during up-to-date check.
	at org.gradle.initialization.DefaultExceptionAnalyser.transform(DefaultExceptionAnalyser.java:74)
	at org.gradle.initialization.MultipleBuildFailuresExceptionAnalyser.transform(MultipleBuildFailuresExceptionAnalyser.java:47)
	at org.gradle.initialization.StackTraceSanitizingExceptionAnalyser.transform(StackTraceSanitizingExceptionAnalyser.java:30)
	at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:143)
	at org.gradle.initialization.DefaultGradleLauncher.executeTasks(DefaultGradleLauncher.java:115)
	at org.gradle.internal.invocation.GradleBuildController$1.call(GradleBuildController.java:77)
	at org.gradle.internal.invocation.GradleBuildController$1.call(GradleBuildController.java:74)
	at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:152)
	at org.gradle.internal.work.StopShieldingWorkerLeaseService.withLocks(StopShieldingWorkerLeaseService.java:38)
	at org.gradle.internal.invocation.GradleBuildController.doBuild(GradleBuildController.java:96)
	at org.gradle.internal.invocation.GradleBuildController.run(GradleBuildController.java:74)
	at org.gradle.tooling.internal.provider.runner.ClientProvidedBuildActionRunner.run(ClientProvidedBuildActionRunner.java:68)
	at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
	at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
	at org.gradle.tooling.internal.provider.ValidatingBuildActionRunner.run(ValidatingBuildActionRunner.java:32)
	at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$3.run(RunAsBuildOperationBuildActionRunner.java:47)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:317)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:309)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:185)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:97)
	at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
	at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner.run(RunAsBuildOperationBuildActionRunner.java:43)
	at org.gradle.tooling.internal.provider.SubscribableBuildActionRunner.run(SubscribableBuildActionRunner.java:51)
	at org.gradle.launcher.exec.InProcessBuildActionExecuter$1.transform(InProcessBuildActionExecuter.java:50)
	at org.gradle.launcher.exec.InProcessBuildActionExecuter$1.transform(InProcessBuildActionExecuter.java:46)
	at org.gradle.composite.internal.DefaultRootBuildState.run(DefaultRootBuildState.java:65)
	at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:46)
	at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:32)
	at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:39)
	at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:25)
	at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:80)
	at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:53)
	at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:62)
	at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:34)
	at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:36)
	at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:25)
	at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:43)
	at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:29)
	at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:59)
	at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:31)
	at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:59)
	at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:44)
	at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:46)
	at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:30)
	at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:67)
	at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
	at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:37)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
	at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
	at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
	at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74)
	at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72)
	at org.gradle.util.Swapper.swap(Swapper.java:38)
	at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
	at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
	at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:62)
	at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
	at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:82)
	at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
	at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50)
	at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:295)
	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
	at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
	at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
Caused by: org.gradle.api.UncheckedIOException: Failed to capture snapshot of output files for task ':UserAppModule:packagePreDebug' property 'outputDirectory' during up-to-date check.
	at org.gradle.api.internal.changedetection.state.CacheBackedTaskHistoryRepository.snapshotTaskFiles(CacheBackedTaskHistoryRepository.java:336)
	at org.gradle.api.internal.changedetection.state.CacheBackedTaskHistoryRepository.createExecution(CacheBackedTaskHistoryRepository.java:158)
	at org.gradle.api.internal.changedetection.state.CacheBackedTaskHistoryRepository.access$100(CacheBackedTaskHistoryRepository.java:66)
	at org.gradle.api.internal.changedetection.state.CacheBackedTaskHistoryRepository$1.getCurrentExecution(CacheBackedTaskHistoryRepository.java:116)
	at org.gradle.api.internal.changedetection.changes.DefaultTaskArtifactStateRepository$TaskArtifactStateImpl.getStates(DefaultTaskArtifactStateRepository.java:208)
	at org.gradle.api.internal.changedetection.changes.DefaultTaskArtifactStateRepository$TaskArtifactStateImpl.isUpToDate(DefaultTaskArtifactStateRepository.java:93)
	at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:50)
	at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
	at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:59)
	at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:101)
	at org.gradle.api.internal.tasks.execution.FinalizeInputFilePropertiesTaskExecuter.execute(FinalizeInputFilePropertiesTaskExecuter.java:44)
	at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:91)
	at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:62)
	at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:59)
	at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
	at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
	at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
	at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.run(EventFiringTaskExecuter.java:51)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:317)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:309)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:185)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:97)
	at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
	at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:46)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$ExecuteTaskAction.execute(DefaultTaskExecutionGraph.java:262)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$ExecuteTaskAction.execute(DefaultTaskExecutionGraph.java:246)
	at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:136)
	at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:130)
	at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.execute(DefaultTaskPlanExecutor.java:201)
	at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.executeWithTask(DefaultTaskPlanExecutor.java:192)
	at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:130)
	... 3 more
Caused by: org.gradle.api.UncheckedIOException: Failed to create MD5 hash for file content.
	at org.gradle.internal.hash.DefaultStreamHasher.hash(DefaultStreamHasher.java:40)
	at org.gradle.internal.hash.DefaultFileHasher.hash(DefaultFileHasher.java:40)
	at org.gradle.api.internal.changedetection.state.CachingFileHasher.snapshot(CachingFileHasher.java:88)
	at org.gradle.api.internal.changedetection.state.CachingFileHasher.snapshot(CachingFileHasher.java:75)
	at org.gradle.api.internal.changedetection.state.CachingFileHasher.hash(CachingFileHasher.java:61)
	at org.gradle.api.internal.changedetection.state.DefaultFileSystemSnapshotter.fileSnapshot(DefaultFileSystemSnapshotter.java:244)
	at org.gradle.api.internal.changedetection.state.DefaultFileSystemSnapshotter.access$700(DefaultFileSystemSnapshotter.java:60)
	at org.gradle.api.internal.changedetection.state.DefaultFileSystemSnapshotter$FileVisitorImpl.visitFile(DefaultFileSystemSnapshotter.java:297)
	at org.gradle.api.internal.file.collections.jdk7.Jdk7DirectoryWalker$1.visitFile(Jdk7DirectoryWalker.java:86)
	at org.gradle.api.internal.file.collections.jdk7.Jdk7DirectoryWalker$1.visitFile(Jdk7DirectoryWalker.java:59)
	at org.gradle.api.internal.file.collections.jdk7.Jdk7DirectoryWalker.walkDir(Jdk7DirectoryWalker.java:59)
	at org.gradle.api.internal.file.collections.DirectoryFileTree.walkDir(DirectoryFileTree.java:154)
	at org.gradle.api.internal.file.collections.DirectoryFileTree.visitFrom(DirectoryFileTree.java:132)
	at org.gradle.api.internal.file.collections.DirectoryFileTree.visit(DirectoryFileTree.java:117)
	at org.gradle.api.internal.changedetection.state.DefaultFileSystemSnapshotter.snapshotAndCache(DefaultFileSystemSnapshotter.java:192)
	at org.gradle.api.internal.changedetection.state.DefaultFileSystemSnapshotter.access$500(DefaultFileSystemSnapshotter.java:60)
	at org.gradle.api.internal.changedetection.state.DefaultFileSystemSnapshotter$4.create(DefaultFileSystemSnapshotter.java:174)
	at org.gradle.api.internal.changedetection.state.DefaultFileSystemSnapshotter$4.create(DefaultFileSystemSnapshotter.java:169)
	at org.gradle.cache.internal.ProducerGuard$StripedProducerGuard.guardByKey(ProducerGuard.java:115)
	at org.gradle.api.internal.changedetection.state.DefaultFileSystemSnapshotter.snapshotDirectoryTree(DefaultFileSystemSnapshotter.java:169)
	at org.gradle.api.internal.changedetection.state.AbstractFileCollectionSnapshotter$FileCollectionVisitorImpl.visitDirectoryTree(AbstractFileCollectionSnapshotter.java:100)
	at org.gradle.api.internal.changedetection.state.AbstractFileCollectionSnapshotter$FileCollectionVisitorImpl.visitCollection(AbstractFileCollectionSnapshotter.java:84)
	at org.gradle.api.internal.file.AbstractFileCollection.visitRootElements(AbstractFileCollection.java:282)
	at org.gradle.api.internal.file.CompositeFileCollection.visitRootElements(CompositeFileCollection.java:206)
	at org.gradle.api.internal.changedetection.state.AbstractFileCollectionSnapshotter.snapshot(AbstractFileCollectionSnapshotter.java:55)
	at org.gradle.api.internal.changedetection.state.DefaultGenericFileCollectionSnapshotter.snapshot(DefaultGenericFileCollectionSnapshotter.java:38)
	at org.gradle.api.internal.changedetection.state.CacheBackedTaskHistoryRepository.snapshotTaskFiles(CacheBackedTaskHistoryRepository.java:334)
	... 33 more
Caused by: java.io.IOException: 另一个程序已锁定文件的一部分,进程无法访问。
	at org.gradle.internal.hash.DefaultStreamHasher.doHash(DefaultStreamHasher.java:54)
	at org.gradle.internal.hash.DefaultStreamHasher.hash(DefaultStreamHasher.java:38)
	... 59 more

see the main error:

Failed to capture snapshot of output files for task ':UserAppModule:packagePreDebug' property 'outputDirectory' during up-to-date check.
> Failed to create MD5 hash for file content.

as you can see from the error above, there is a problem with the input directory of apk for this project:

so we can either change the directory or comment the directory and it will run

of course I chose to annotate the directory

first