简体   繁体   中英

Release only problem | app:lintVitalRelease

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

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.

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

    lintOptions { 
      checkReleaseBuilds false 
}
  

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM