Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

A failure occurred while executing com.android.build.gradle.internal.tasks

Finally found a solution for this by adding this line to gradle.properties.

org.gradle.jvmargs=-Xmx4608m


Try this, in Android Studio

File > Invalidate Caches/Restart... 

I already had multidex enabled but the version was too old so upgraded and it fixed the issue:

// Old version
implementation "com.android.support:multidex:1.0.3"
// New version
def multidex_version = "2.0.1"
implementation "androidx.multidex:multidex:$multidex_version"

I removed this issue by adding the following lines

add multiDexEnabled true in android>app>build.gradle inside defaultConfig

add implementation 'com.android.support:multidex:1.0.3' in android>app>build.gradle inside dependencies


Encountered Similar issue... the fix for me was changing/updating the gradle version

   classpath "com.android.tools.build:gradle:4.1.2" 

to

   classpath "com.android.tools.build:gradle:4.1.3"

worked for me


In my case, I enabled multidex

Open [project_folder]/app/build.gradle and add following lines.

defaultConfig {
    ...

    multiDexEnabled true
}

and

dependencies {
    ...

    implementation 'com.android.support:multidex:2.0.1'
}

I got an stacktrace similar to yours only when building to Lollipop or Marshmallow, and the solution was to disable Advanved profiling.

Find it here:

Run -> Edit Configurations -> Profiling -> Enable advanced profiling

https://stackoverflow.com/a/58029739/860488