'Lint found fatal errors while assembling a release target

383/5000 I have an app that gives me compilation errors when I change it to release mode to upload it to the play store

I've tried analyzing-inspecting code and I do not have any error.

I have also tried the compilation sugestion in the build build gradle and it does not give an error, but when I try to install the apk it gives me an error: "the APK failed to install. Error: Could not stop error string"

org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:lintVitalRelease'.
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:100)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:70)
    at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51)
    at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:62)
    at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
    at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:60)
    at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:97)
    at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:87)
    at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:52)
    at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
    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.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.java:248)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:241)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:230)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:123)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:79)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:104)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:98)
    at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:626)
    at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:581)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:98)
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
    at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
    at java.lang.Thread.run(Thread.java:745)
Caused by: org.gradle.api.GradleException: Lint found fatal errors while assembling a release target.

To proceed, either fix the issues identified by lint, or modify your build script as follows:
...
android {
    lintOptions {
        checkReleaseBuilds false
        // Or, if you prefer, you can continue to check for errors in release builds,
        // but continue the build even when errors are found:
        abortOnError false
    }
}
...
    at com.android.tools.lint.gradle.LintGradleExecution.abort(LintGradleExecution.java:199)
    at com.android.tools.lint.gradle.LintGradleExecution.runLint(LintGradleExecution.java:263)
    at com.android.tools.lint.gradle.LintGradleExecution.lintSingleVariant(LintGradleExecution.java:359)
    at com.android.tools.lint.gradle.LintGradleExecution.analyze(LintGradleExecution.java:93)
    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:87)
    at com.android.build.gradle.tasks.LintPerVariantTask.lint(LintPerVariantTask.java:41)
    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:73)
    at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:46)
    at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:39)
    at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:26)
    at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:780)
    at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:747)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:121)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:110)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:92)
    ... 32 more


Solution 1:[1]

  1. You can use Analyze > Inspect Code menu to manually run inspections. The results appear in the Inspection Results window. This way you can view and fix the real issues.

  2. You can still view them from app\build\reports\lint-results-release-fatal.html file without using aforementioned manual inspection menu.

  3. Although it's not recommended you can also suppress the lint warnings by adding below code into your build.gradle as Android Studio suggests. But keep in mind that this will not fix any real issues.

android {
    lintOptions {
        checkReleaseBuilds false
        // Or, if you prefer, you can continue to check for errors in release builds,
        // but continue the build even when errors are found:
        abortOnError false
    }
}

Solution 2:[2]

You can find out details in your app path

 /YOUR_APPLICATION/app/build/reports/ 

enter image description here

in this folder, there is a HTML document that describes the error.

For more information, you can visit the page that i find a solution.

https://dominoc925.blogspot.com/2018/08/how-to-find-cause-of-lint-error-while.html

Solution 3:[3]

Here I have written an article on all possible solutions to resolve Lint found fatal errors issue.

Generally, you can resolve it in the following way:

Android studio shows all build errors in html & xml file present at the following link. Just open that file in your browser, check the error and fix it.

/YOUR_APPLICATION/app/build/reports/lint-results-release-fatal.html

enter image description here

Sample Error

enter image description here

Solution 4:[4]

This works for me

lintOptions { 
    checkReleaseBuilds false
}

Add this code into the build.gradle file within android {} section

Solution 5:[5]

Make sure you defined all the translations in all the string.xml files in your application.

Solution 6:[6]

For me i checked the errors in the xml and html files in /APPLICATION/app/build/reports Then i fixed all i could fix and for the rest i suppressed them by adding to my build.gradle the code below:

android {
    lintOptions {
        checkReleaseBuilds false
        abortOnError false
    }
}

This prevented android studio from aborting the build because of the remaining errors

Solution 7:[7]

I faced the similiar issue and followed this way Analyze > Inspect Code. In my case it was the xml issues.

Solution 8:[8]

For me, the results file lint-definite-release.xml was located at app/build/intermediates/lint_vital_partial_results/release/out. I'm using Android Studio 2020.3.1 Patch 4.

Solution 9:[9]

After a while I find solution for my problem. Just check for differences between strings.xml(for different languages - if you have)

Solution 10:[10]

Add this to build.gradle(Module: AppName)

below

android {

these lines

lintOptions{
    checkReleaseBuilds false
}

above these lines

compileSdkVersion 31
defaultConfig {
    applicationId "com.example.myapplication"
    minSdkVersion 21
    targetSdkVersion 31
    versionCode 1
    versionName "1.0"
    multiDexEnabled true
}

}

Solution 11:[11]

as I see you are trying to have a bundle or any kind of version edition of your newly edited app, but here you have to pay attention to the minimumsdk and target sdk and some other settings in your app which may differ from the last android studio and play store standards so you have to edit them and if needed change them, but these kind of error are located in a file in the below log or report folder it is html base and try to see it in a browser the file is in this directory in your project: app\build\reports try to open it by a browser, it will help you and press what is preventing you from generating a bundle or app with a signature encrypted.

Solution 12:[12]

I had the same issue and followed this way to find the error and fix it. Analyze > Inspect Code. After that I found that the current targetSdkVersion was not supported. So I increased targetSdkVersion in the default config and that is how it was fixed.

Solution 13:[13]

I know there are plenty of answers given in this thread already, this is for those who want to know the issue. This error generally pops up because of XML/Layout/Resource file errors.
To solve this just recheck your layouts by either manually or mentioned methods in the above-given answers
I'm sure you'll find the root of cause...

Solution 14:[14]

I had same problem in generate Apk process . this showing errors process is improved in new version of gradle .I updated my gradle version to the last version then generated it again .it Showed Fatal Error in my Xml codes in best way.

Solution 15:[15]

File > Invalid Caches/Restart has fixed the issue for me. I am just getting started with the Android but I thought to try this before trying what's mentioned above and it worked.