Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio 4.0.2 Gradle Error: No value has been specified for property 'enableGradleWorkers'

I am using Android Studio 4.0.2 and I am getting error:

No value has been specified for property 'enableGradleWorkers'.
like image 502
solaza Avatar asked Oct 09 '20 08:10

solaza


2 Answers

This happens because of crashlytics gradle plugin on version 2.7.1

To fix, simple downgrade to the latest working version:

open your project level build.gradle

 dependencies {
     //your stuff
        //classpath 'com.google.firebase:firebase-crashlytics-gradle:2.7.1' THIS VERSION DOESNT WORK
        classpath 'com.google.firebase:firebase-crashlytics-gradle:2.6.1'
    }

UPDATE
As suggested by @صلي علي محمد Atef Farouk, recent versions of firebase-crashlytics-gradle plugin must be applied by last on build.grandle

So in your project level build.gradle you can use any version of but in the module level build.gradle you must ensure that com.google.firebase.crashlytics is the last one to be applied:

plugins {
    id 'com.android.application'
    id 'com.google.gms.google-services'
    id 'com.google.firebase.crashlytics'
}
like image 90
Rafael Lima Avatar answered Oct 02 '22 17:10

Rafael Lima


These are gradle combinations working fine for me .

in project level:

    classpath 'com.android.tools.build:gradle:4.2.2'
    classpath 'com.google.gms:google-services:4.3.8'
    classpath 'com.google.firebase:firebase-crashlytics-gradle:2.7.1' 

so, if like this don't downgrade to any other version.

The trick is in gradle app level:

how? you need to move this line apply plugin: 'com.google.firebase.crashlytics' to be last line in the file. like this:

apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'
like image 29
صلي علي محمد Atef Farouk Avatar answered Oct 02 '22 17:10

صلي علي محمد Atef Farouk