3

I created an app with android studio, but every time I try to use command gradle build to build the application, it says "lint failed". When I checked the debug info of gradle build, it said:

21:10:26.215 [DEBUG] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] Task worker [Thread[Daemon,5,main]] finished, busy: 1.263 secs, idle: 0.034 secs
21:10:26.219 [ERROR] [org.gradle.BuildExceptionReporter] 
21:10:26.221 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception.
21:10:26.222 [ERROR] [org.gradle.BuildExceptionReporter] 
21:10:26.222 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong:
21:10:26.223 [ERROR] [org.gradle.BuildExceptionReporter] Execution failed for task ':MyApp:lint'.
21:10:26.224 [ERROR] [org.gradle.BuildExceptionReporter] > class org.objectweb.asm.tree.ClassNode has interface org.objectweb.asm.ClassVisitor as super class
21:10:26.225 [ERROR] [org.gradle.BuildExceptionReporter] 
21:10:26.226 [ERROR] [org.gradle.BuildExceptionReporter] * Exception is:
21:10:26.228 [ERROR] [org.gradle.BuildExceptionReporter] org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':MyApp:lint'.
21:10:26.229 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
21:10:26.229 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
21:10:26.230 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
21:10:26.231 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64)
21:10:26.231 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
21:10:26.232 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:42)
21:10:26.233 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
21:10:26.233 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
21:10:26.234 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
21:10:26.235 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailure(AbstractTask.java:289)
21:10:26.235 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.executeTask(AbstractTaskPlanExecutor.java:79)
21:10:26.236 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:63)
21:10:26.237 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:51)
21:10:26.237 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:23)
21:10:26.237 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:86)
21:10:26.238 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:29)
21:10:26.238 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)
21:10:26.239 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExecuter.java:23)
21:10:26.239 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:67)

I have searched a lot but could not find a solution for it. Anyone can help about it? Thank in advance.

1
  • It turned out that there is a bug about lint of gradle before. I am not sure it was resolved yet. but you can use the build parameter to forbid lint with:gradle -x lint build Commented Mar 1, 2015 at 2:41

1 Answer 1

7

I fixed the same issue by adding lintOptions in build.gradle :

android {

    lintOptions {
        abortOnError false
    }
}

IntelliJ hinted : Fix the issues identified by lint, or add the following to your build script to proceed with errors:

Sign up to request clarification or add additional context in comments.

2 Comments

I added these in the my build.gradle, but the issues still happened.
Is it possible to do this from the top level script like in the question here: stackoverflow.com/questions/24420391/…?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.