A failure occurred while executing com.android.build.gradle.tasks.PackageAndroidArtifact$IncrementalSplitterRunnable
Asked Answered
P

5

13

I got the error when I trying to convert signing in apk. before it was working. after adding the buildTyper it's not working. can anyone help me with this issue? or anything did wrongly?

    release {
        minifyEnabled true
        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        resValue "string", "google_maps_key", "AIzaxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
        debuggable true
        multiDexEnabled true
        signingConfig signingConfigs.Able
        jniDebuggable true
        renderscriptDebuggable true
    }

    debug {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        resValue "string", "google_maps_key", "AIzaxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
    }
Proponent answered 5/12, 2020 at 14:0 Comment(0)
T
5

The approved solution defeats the purpose of having a smart Gradle build process which compiles and links only the required code. If every time this error occurs the solution is to stop and delete the build you are killing productivity.

I get this error about 1 out of every 10 builds.

My quick fix - is within Android Studio - open the Terminal panel (typically bottom of studio). Run shell command

rm -rf build/output/apk

This always works - but still is a big pain to do every 10 builds. I have had this problem for the last year, so multiple OS updates, multiple Studio updates, etc.

Wish they would fix this. I have tried to disable "incremental building", but no impact on this problem.

gradle.properties

org.gradle.parallel=false
org.gradle.caching=false
org.gradle.configureondemand=false

build.gradle

gradle.projectsEvaluated {
    tasks.withType(JavaCompile) {
        options.incremental = false

    }
}
Telefilm answered 29/7, 2021 at 20:45 Comment(3)
where to add these gradle.projectsEvaluated { tasks.withType(JavaCompile) { options.incremental = false } }Unfit
This doesn't work for me.Jotham
As I stated, disabling the incremental builds in build.gradle made no difference. The gradle syntax was found here: #38299195Telefilm
H
24

Adding this line org.gradle.jvmargs=-Xmx4608m to gradle.properties fixed it.

Because while I got A failure occurred while executing com.android.build.gradle.tasks.PackageAndroidArtifact$IncrementalSplitterRunnable reported, it also said something like ...Java Heap Size.

Hodson answered 8/11, 2021 at 15:59 Comment(2)
This the correct answer.Chantal
this answer fixed the error for meGown
A
12

The solution is so easy! Before start build or signing your project,

  1. close android studio
  2. delete manually \app\build and \app\release and \app\debug folders
  3. close all other folders
  4. try again build or signing your project

Pay attention that no folder should be open from \app\debug and \app\release or any subdirectory of them in file explorer!

Arcane answered 3/1, 2021 at 11:57 Comment(2)
Wow. it's working now.. thanks for helping.Proponent
Really the real-life equivalent of "have you tried turning it off and then on"?Nullipore
T
5

The approved solution defeats the purpose of having a smart Gradle build process which compiles and links only the required code. If every time this error occurs the solution is to stop and delete the build you are killing productivity.

I get this error about 1 out of every 10 builds.

My quick fix - is within Android Studio - open the Terminal panel (typically bottom of studio). Run shell command

rm -rf build/output/apk

This always works - but still is a big pain to do every 10 builds. I have had this problem for the last year, so multiple OS updates, multiple Studio updates, etc.

Wish they would fix this. I have tried to disable "incremental building", but no impact on this problem.

gradle.properties

org.gradle.parallel=false
org.gradle.caching=false
org.gradle.configureondemand=false

build.gradle

gradle.projectsEvaluated {
    tasks.withType(JavaCompile) {
        options.incremental = false

    }
}
Telefilm answered 29/7, 2021 at 20:45 Comment(3)
where to add these gradle.projectsEvaluated { tasks.withType(JavaCompile) { options.incremental = false } }Unfit
This doesn't work for me.Jotham
As I stated, disabling the incremental builds in build.gradle made no difference. The gradle syntax was found here: #38299195Telefilm
P
0

Add this to gradle.properties at proj root dir:

android.useNewApkCreator=false
Purity answered 1/9, 2023 at 10:59 Comment(0)
I
0

Simply running flutter clean and then flutter pub get solved the problem for me.

Isaiah answered 24/4 at 13:33 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.