':app:lintVitalRelease' error when generating signed apk

JavaAndroidGradle

Java Problem Overview


I've tried to upload my apk on google play and encountered an error message: "You uploaded a debuggable APK. For security reasons you need to disable debugging before it can be published in Google Play. Learn more about debuggable APKs."

Then I wrote android:debuggable="false" in my manifest and tried again. I've encountered the same error, so I've set the build variant from my module to release and tried generated an apk again, but this time, this error is generated:

Error:Gradle: Execution failed for task ':app:lintVitalRelease'.
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
      }
  }
  ...

Java Solutions


Solution 1 - Java

I wouldn't recommend turning off the lint checks, they're there for a reason. Instead, check what the error is and fix it.

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.

It would be nice if Gradle could make it a little more clear where the error report is generated.

Solution 2 - Java

I had this problem and solved it by adding:

lintOptions { 

    checkReleaseBuilds false

}

to my build.gradle file within the android{ } section.       

Solution 3 - Java

if you want to find out the exact error go to the following path in your project: /app/build/reports/lint-results-release-fatal.html(or .xml). The easiest way is if you go to the xml file, it will show you exactly what the error is including its position of the error in your either java class or xml file. Turning off the lint checks is not a good idea, they're there for a reason. Instead, go to:

    /app/build/reports/lint-results-release-fatal.html or 
    /app/build/reports/lint-results-release-fatal.xml

and fix it.

In Kotlin is different. First you need to set the following code in Android section of build.gradel of the app folder.

     android {
          :
          lintOptions {
            baseline(file("lint-baseline.xml"))
          }
      }

Then run lint from the IDE (Analyze > Inspect Code) or from the command line as follows.

      $ ./gradlew lintDebug

...

The output prints the location of the lint-baseline.xml file within app folder but sometimes within app/src folder as well /app/lint-baseline.xml

Solution 4 - Java

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

Solution 5 - Java

In case that you may trying to locate where the problem is, I found mine in the following path of my project: /app/build/reports/lint-results-release-fatal.html(or .xml).

Hope this helps!

Solution 6 - Java

I have faced same issue when creating signed apk from android studio. I just change little bit change on build.gradle file inside android {}

lintOptions {
        checkReleaseBuilds false
        abortOnError false
    }

Solution 7 - Java

How to find error details

Anylyze -> Inspect Code

enter image description here

Then in Inspection Results you will see an error

enter image description here

In my case build failed due to unresolved javadoc reference in Google IAP 

Solution 8 - Java

***Try this***

 buildTypes {
        release {
            lintOptions {
                disable 'MissingTranslation'
                checkReleaseBuilds false
                abortOnError false
            }
            minifyEnabled false
            signingConfig signingConfigs.release
        }
    }

Solution 9 - Java

You can find more info choosing assemble from gradle build tab:enter image description here

Solution 10 - Java

Try These 3 lines in your app.gradle file.

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 11 - Java

Hello Guys this worked for me, I just modify my BuildTypes like this:

buildTypes {
        release {
            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
                }
            }
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

Solution 12 - Java

My problem was a missing translation. I had a settings.xml that was not translated as it was not needed, so I had to add "translatable="false" to the strings:

This string doesn't need translation

Solution 13 - Java

Just find the error reason in here and fix it.

yourProject/app/build/reports/lint-results-release-fatal.xml

Solution 14 - Java

enter image description here

Add this inside android {} build.gradle(Module:App)

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 15 - Java

My problem was a missing translation. I had a settings.xml that was not translated as it was not needed, so I had to add "translatable="false" to the strings:

<string translatable="false" name="stringname">This string doesn't need translation</string>

Solution 16 - Java

Solve this Issue Using this in build.gradle (app) File Inside main Android { inside }

  buildTypes {
      //  crunchPngs false // or true   when png error
        release {
            lintOptions {
                checkReleaseBuilds false
                abortOnError false
            }
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

Solution 17 - Java

As many people have suggested, it is always better to try and fix the error from the source. check the lint generated file

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

read the file and you will be guided to where the error is coming from. Check out mine: the error came from improper view constraint.

Solution 18 - Java

Try below code

buildTypes {
	release {
		lintOptions {
			disable 'MissingTranslation'
			checkReleaseBuilds false
			abortOnError false
		}
		minifyEnabled false
		signingConfig signingConfigs.release
	}
}

Solution 19 - Java

Windows -> references ->Android->lint error checking.

un tick Run full error.......

enter image description here

Solution 20 - Java

Go to build.gradle(Module:app)

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 21 - Java

Remove that statement from your manifest altogether, Eclipse will handle that for you on the fly.

Solution 22 - Java

In my case the problem was related to minimum target API level that is required by Google Play. It was set less than 26.

Issue disappeared when I set minimum target API level to 26.

Solution 23 - Java

Don't disable the lint option

Check the Lint Report for error and warning

PATH: > YourAppProjectFolder\app\build\reports

Solve all error and warning:)

Solution 24 - Java

You should add the code in project level gradle file for generating apk overwriting over errors

Solution 25 - Java

    lintOptions {
      checkReleaseBuilds false
      abortOnError false
    }

The above code can fix the problem by ignoring it, but it may result in crashing the app as well.

The good answer is in the following link:

https://stackoverflow.com/questions/24098494/error-when-generate-signed-apk/52140460#52140460

Solution 26 - Java

This problem came to me when I updated the Android Gradle Plugin Version to 4.0.1 and the Gradle version to 6.1.1.

If someone is in a hurry, just downgrade the Gradle Plugin Version to 3.6.3 and the Gradle version to 5.6.4. It worked for me.

Solution 27 - Java

Upgrading gradle distribution url to,

// android/gradle/wrapper/gradle-wrapper.properties
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip

and upgrading buildscript -> dependencies -> classpath to,

// android/build.gradle
classpath 'com.android.tools.build:gradle:7.0.0'

fixed the issue for me

Solution 28 - Java

If you add in app.gradle under android{

lintOptions {

    quiet true
    abortOnError false
}

}

It will get work

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionuser3716366View Question on Stackoverflow
Solution 1 - JavaGraydyn YoungView Answer on Stackoverflow
Solution 2 - JavanaileView Answer on Stackoverflow
Solution 3 - JavaYosidroidView Answer on Stackoverflow
Solution 4 - JavaRobertoView Answer on Stackoverflow
Solution 5 - JavaPecolyte WangView Answer on Stackoverflow
Solution 6 - JavaDhruv RavalView Answer on Stackoverflow
Solution 7 - JavaMikhailView Answer on Stackoverflow
Solution 8 - JavaAmit rajView Answer on Stackoverflow
Solution 9 - JavaMateusz KaflowskiView Answer on Stackoverflow
Solution 10 - JavaRehan SarwarView Answer on Stackoverflow
Solution 11 - JavaDoctorDroid HaitiView Answer on Stackoverflow
Solution 12 - JavaHarsh MasandView Answer on Stackoverflow
Solution 13 - JavaAmir Hossein GhasemiView Answer on Stackoverflow
Solution 14 - JavaPanneerchelvam PiratheepanView Answer on Stackoverflow
Solution 15 - JavatomDevView Answer on Stackoverflow
Solution 16 - JavaKeshav GeraView Answer on Stackoverflow
Solution 17 - JavaQuwaysimView Answer on Stackoverflow
Solution 18 - JavaSheikh Ahmed QureshiView Answer on Stackoverflow
Solution 19 - JavasomeoneView Answer on Stackoverflow
Solution 20 - JavaAzmat AliView Answer on Stackoverflow
Solution 21 - JavaEran GoldinView Answer on Stackoverflow
Solution 22 - JavamdicosimoView Answer on Stackoverflow
Solution 23 - JavaSwarnava ChakrabortyView Answer on Stackoverflow
Solution 24 - JavaKamalView Answer on Stackoverflow
Solution 25 - JavaYosidroidView Answer on Stackoverflow
Solution 26 - JavaJeiel JunioView Answer on Stackoverflow
Solution 27 - JavaAlish GiriView Answer on Stackoverflow
Solution 28 - JavaAlpesh SorathiyaView Answer on Stackoverflow