2

got a problem with gradle build, specifically in release mode. Everything works fine in debug. I couldn't find anything about this issue. Any idea about the issue?

> Stack trace:
FAILURE: Build failed with an exception.


    FAILURE: Build failed with an exception.
        * What went wrong:
        Execution failed for task ':app:lintVitalRelease'.
        Lint infrastructure error
          Caused by: java.lang.reflect.InvocationTargetException
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:498)
            at com.android.tools.lint.gradle.api.ReflectiveLintRunner.runLint(ReflectiveLintRunner.kt:38)
            at com.android.build.gradle.tasks.LintBaseTask.runLint(LintBaseTask.java:114)
            at com.android.build.gradle.tasks.LintPerVariantTask.lint(LintPerVariantTask.java:63)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:498)
            at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:103)
            at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:49)
            at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:42)
            at ...
     ...
            at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
            ... 109 more

tim_yates
  • 167,322
  • 27
  • 342
  • 338
SenyaOhar
  • 81
  • 1
  • 8
  • not the same as [this](https://stackoverflow.com/questions/49286268/error-execution-failed-for-task-app-lintvitalrelease-any-one-can-solve-it)? – a_local_nobody Mar 19 '20 at 15:25
  • nope, this is a little bit different. i get Caused by: java.lang.ClassNotFoundException: com.android.tools.lint.checks.AnnotationDetector. The thing is that Idk where should I find it and how to repair it. maybe i'm using some kinda not compatible package with sdk. idk – SenyaOhar Mar 19 '20 at 15:42

2 Answers2

0

I have solved it on my own. Firstly, I checked Android Studio, config of that, java, gradle, but the problem was easy. Just reinstalled SDK.

SenyaOhar
  • 81
  • 1
  • 8
0

Open app level build.gradle file and add the code under android

    lintOptions { 
      checkReleaseBuilds false 
}
  
Ashutosh singh
  • 820
  • 6
  • 17