Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 789 Vote(s) - 3.49 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Execution failed for task ':app:lintVitalRelease'. Flutter

#1
Why I get these errors I try to release apk

I run "flutter build apk --release"

Execution failed for task ':app:lintVitalRelease'.
[![:app:lintVitalRelease][1]][1]
A problem occurred configuring root project 'android_intent'.



[1]:


> * What went wrong: A problem occurred configuring root project 'android_intent'.
> > SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.





android/app/build.gradle

def localProperties = new Properties() def localPropertiesFile = rootProject.file('local.properties') if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
} }

def flutterRoot = localProperties.getProperty('flutter.sdk') if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") }

def flutterVersionCode = localProperties.getProperty('flutter.versionCode') if (flutterVersionCode == null) {
flutterVersionCode = '1' }

def flutterVersionName = localProperties.getProperty('flutter.versionName') if (flutterVersionName == null) {
flutterVersionName = '1.0' }

apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 28

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}

lintOptions {
disable 'InvalidPackage'
}

defaultConfig {
// TODO: Specify your own unique Application ID (

[To see links please register here]

).
applicationId "com.example.deleviry"

minSdkVersion 21
targetSdkVersion 28
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
multiDexEnabled true
}

buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
}
} }

flutter {
source '../..' }

dependencies {
implementation 'com.google.firebase:firebase-core:17.2.0'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" }

apply plugin: 'com.google.gms.google-services'

android/build.gradle

buildscript {
ext.kotlin_version = '1.3.50'
repositories {
google()
jcenter()
}

dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
classpath 'com.google.gms:google-services:4.3.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
} }

allprojects {
repositories {
google()
jcenter()
} }

rootProject.buildDir = '../build' subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}" } subprojects {
project.evaluationDependsOn(':app') }

task clean(type: Delete) {
delete rootProject.buildDir }


Reply

#2

If your error says `debug/libs.jar`, build `--debug` then `--release`:

```
flutter build apk --debug
flutter build apk --release
```


If your error says `profile/libs.jar`, build `--profile` then `--release`:


```
flutter build apk --profile
flutter build apk --release
```

Taken from [here][1]


[1]:

[To see links please register here]

Reply

#3
Upgrading gradle build tools seems to break some lints.

To fix this you can:

> If your error says debug/libs.jar, build --debug then --release. <br>
> If your error says profile/libs.jar, build --profile then --release.

from

[To see links please register here]


If the above doesn't work you can disable the check.

Add `checkReleaseBuilds false` in `lintOptions` in the **android/app/build.gradle** file.


android {
...
lintOptions {
disable 'InvalidPackage'
checkReleaseBuilds false //<- add this line
}
}
Reply

#4
If you're having this issue and you can't fix it with either fixes like me, you might be having different flavors. I had to run the run and run --release command for every flavor before I could build one without an error.

so
flutter run --flavor dev
... (do so for every flavor)
flutter run --flavor lastFlavor
then
flutter build apk --flavor dev (error)
... (do so for every flavor)
flutter build apk --flavor lastFlavor (SUCCESS!)

and from now on you can build every flavor without error :)
Reply

#5
I've stuck to the latest Android Studio Gradle plugin from the `3.x` series (`3.6.4`) paired with an up-to-date Gradle version (AS plugin `3.6.4` + Gradle `6.6` yields no error for me).

_Edit: As of today July 13th 2021, Flutter 2.2.3 runs fine with Android Studio Gradle plugin version 4.2.2 and Gradle 6.8.3 (stable)_
Reply

#6
Not sure if this is the correct way, but I solved similar issue by adding these lines

```
release {
signingConfig signingConfigs.debug
shrinkResources false // Add this line
minifyEnabled false // Also add this line
}
```
Reply

#7

in my case, this part of the code was absent in android/app/build.gradle so i added it and it worked.



lintOptions {
disable 'InvalidPackage'
checkReleaseBuilds false
}
Reply

#8
I have resolved this issue by adding classpath "com.android.tools.build:gradle:7.2.1" in android>build.gradle dependecies. It worked perfectly.

Note: my gradle wrapper version was https\://services.gradle.org/distributions/gradle-7.4.2-all.zip in gradle-wrapper.properties

Basically this problem occurred some of dependencies uses latest gradle version and your project version is different.
Reply

#9
lintOptions {
disable 'InvalidPackage'
checkReleaseBuilds false //<- add this line
}


add this code will solve your problem
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through