[Solved] Error: Execution failed for task ‘:app: lintVitalRelease’ any one can solve it?

Why I get this error I try to clean and rebuild application and make
application release true and I get same error

Error:Execution failed for task ‘:app:lintVitalRelease’.
java.lang.IllegalStateException: Expected BEGIN_ARRAY but was STRING at line 1 column 1 path $

    apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion '26.0.2'
    useLibrary 'org.apache.http.legacy'
    defaultConfig {
        applicationId "x.x.x"
        minSdkVersion 15
        targetSdkVersion 25
        versionCode 95
        versionName '5'

        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    productFlavors {
    }

}

Solution #1:

To find out why lint fails do this:

  1. Run lintVitalRelease

You can do it from Gradle window

enter image description here

  1. Under Run tab, you will see error logs

enter image description here

For me, it was wrong constraint in ConstraintLayout XML.

enter image description here

Respondent: Ilia Grabko

Solution #2:

Based off this Post

Edit:
I removed the link because the thread is no longer there

What you need to do is add this chunk of code to your build.gradle file
in the android{} section

lintOptions { 
    checkReleaseBuilds false
}

So like this

android {
    ...
    lintOptions {
        checkReleaseBuilds false
    }
}

Update:

Here is another post talking about a similar problem. It seems like there are various reasons this error can occur. While disabling the checkReleaseBuilds will work. It’s recommended to find what the problem is and fix it. Most common error seems to be missing translations in the strings.xml file.

I recommend checking out this post for more help

Error when generate signed apk

Respondent: nickc

Solution #3:

lintOptions {
        checkReleaseBuilds false
        abortOnError false
    }
Respondent: Makvin

Solution #4:

The error report is saved to [app module]/build/reports/lint-results-yourBuildName-fatal.html. You can open this file in a browser to read about the errors.

src: https://stackoverflow.com/a/50239165/365229

Respondent: Behrouz.M

Solution #5:

Open your build.gradle file and add the code below under android:

android {

    lintOptions { 
      checkReleaseBuilds false 
    }
Respondent: Emmanuel Ametepee

Solution #6:

File > Invalidate Caches/Restart… worked for me.

Respondent: Kamran Riyaz

Solution #7:

In my opinion don’t use “checkReleaseBuilds false”. This broke my whole release build and I only saw a white screen.

A current workaround is running:

flutter run --profile
flutter run --debug
flutter run --release

Currently that’s the only thing that worked for me.
There is an open issue here: https://issuetracker.google.com/issues/158753935

Respondent: error1337

Solution #8:

Make sure to have
jcenter()
in both buildscript and allprojects in your build.gradle android{} section

Respondent: Ming Aivo

Solution #9:

I was also getting an error like

         > Failed to transform '/Users/michaelbui/Projects/counter/build/app/intermediates/flutter/debug/libs.jar' using Jetifier. Reason: FileNotFoundException, message: /Users/michaelbui/Projects/counter/build/app/intermediates/flutter/debug/libs.jar (No such file or directory). (Run with --stacktrace for more details.)

while building the app after the latest update, but then I disabled the lint task in android/app/build.gradle

lintOptions {
    disable 'InvalidPackage'
    checkReleaseBuilds false
}

and this worked for me.

Respondent: Anshul Kataria

Solution #10:

Simple and Working

Solution 1

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

android {
        lintOptions {
            checkReleaseBuilds false
            abortOnError false
        }
    }

Solution 3

 android {
        lintOptions {
           disable 'MissingTranslation'
           abortOnError false
        }
    }

Notes: There are two type uses option ->

1

 lintOptions {
        //TODO
    }

2

android {
        lintOptions {
           // TODO
        }
    }

Thank You

Respondent: Kumar Santanu

The answers/resolutions are collected from stackoverflow, are licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0 .

Leave a Reply

Your email address will not be published.