Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error: Execution failed for task ':app: lintVitalRelease' any one can solve it?

Tags:

java

android

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 {
    }

}
like image 519
elpatrue diab Avatar asked Mar 14 '18 19:03

elpatrue diab


4 Answers

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

like image 78
Ilia Grabko Avatar answered Nov 12 '22 00:11

Ilia Grabko


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

like image 44
nickc Avatar answered Nov 11 '22 23:11

nickc


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

like image 23
Behrouz.M Avatar answered Nov 11 '22 23:11

Behrouz.M


lintOptions {
        checkReleaseBuilds false
        abortOnError false
    }
like image 21
Makvin Avatar answered Nov 11 '22 23:11

Makvin