122

I am getting following error in gradle build.

Error:null value in entry: incrementalFolder=null

How can I fix this?

Jorgesys
  • 124,308
  • 23
  • 334
  • 268
Ishvar Kikani
  • 1,394
  • 2
  • 8
  • 13

12 Answers12

308

I agree with Maravilho Singa's answer. It appears to be a bug in gradle.

I found another solution here:

removing the .gradle directory in the root project directory will fix the problem.

  • 4
    Work fine after removing the .gradle directory in the root and the clean build – Vinil Chandran Jun 11 '17 at 16:26
  • 15
    As a general rule for anybody reading this answer: First move (rename) the folder, try the solution, if it works then remove that folder you don't need anymore. Safer than just removing stuff people on the internet told you to remove. – arekolek Jul 31 '17 at 07:01
  • This will solve the problem. But every time I get the problem? – noobEinstien Dec 05 '17 at 14:41
  • 2
    the .gradle folder was hidden and not visible in my mac Finder. Open terminal and run the command " ls -ltra " (ignore double quotes) to see the .gradle folder and then run the command " rm -rf .gradle" to delete the folder. This fixed my problem – mujeeb Dec 18 '17 at 12:28
  • It seems to be a file corrupt problem on build. Right? – Lucas Moretto Mar 20 '18 at 20:08
  • ...\\.gradle\ this is hidden folder, so check if you can see hidden folders first – Vladislav Shcherbakov Apr 24 '18 at 21:10
  • @mujeeb pressing Command Shift . (dot) reveals the hidden files, leave the terminal alone )) – rommex Sep 25 '19 at 09:22
  • @arekolek as a general rule use git and you will never need to secretly move, carefully rename or be afraid to change anything – rommex Sep 25 '19 at 09:23
  • 1
    @rommex .gradle folder is normally one of the entries in .gitignore, so git can't help here – arekolek Sep 25 '19 at 09:34
32

Just delete the .gradle directory and rebuild app. Undo Try to bring back .gradle directory. There by your error will be removed.

thiru-wta
  • 317
  • 3
  • 5
9

I think it has something to do with iCloud. I've found that each time that happens with my projects it's because the .gradle file had been uploaded into iCloud and was no longer available in my computer. So either delete the .gradble file and have it regenerated, or recover it from iCloud by clicking it.

  • 1
    Looks like that was my problem too. I just navigated to my folder on Finder, right clicked and click on "Download now". Then it downloaded my folder back from iCloud to my computer. I closed Android Studio, open again, and it works now =) Thank you – leoneboaventura Jul 08 '17 at 16:11
  • I'm on Windows, but using TFS with Git, so it's gotta be the versioning or update/storing commonality – Stephen J Sep 21 '17 at 17:43
  • same happened to me, I just dragged the android project folder from the cloud back to my desktop and then it worked again. – Charlie Mar 22 '18 at 14:28
5
  1. Empty all "build" folders in your project
  2. Copy all your project files and folders
  3. Create a new folder and past it there
  4. Open android Studio and import project
  5. Wait Android Studio to download all dependecies.

That's all. It will work perfectly

Maravilho Singa
  • 224
  • 3
  • 12
5

delete the .gradle file from the root directory and then clean the project, by this your .gradle file be recreated and your error will be resolved.

Diya Bhat
  • 235
  • 3
  • 12
3

This is gradle bug. Go to your project folder, delete your gradle and build folder. Sync the project with gradle files. This will resolve the problem.

Kimmi Dhingra
  • 2,249
  • 22
  • 21
3

I am working on my project and suddenly lights goes off, When i started Android studio and run the project, At the moment Android studio syncing the Gradle, And the same problem occurs.

Solution=> Please Tack Backup of your project before proceeding these tasks. Delete All folder and files present in Build folder and Gradle folder. Uploading Images That will help you. enter image description here

Praveen Gaur
  • 211
  • 3
  • 6
3

Error:null value in entry: libOutputDir=null

put any new projects .gradle file into your app but before that you must backup your app. i solved this error using this method.

  • I hope its works for other.
3

I resolved my error by removing the .gradle as well as .idea directory from the root project directory.

Monika Moon
  • 188
  • 3
  • 9
2

I had the same issue. importing files into a new project fixed it for me.

superheron
  • 343
  • 1
  • 3
  • 9
1

I stuck in the problem like this. What I done is Delete the .Gradle Folder From the Project File.

Then Built and Clean the Project. Certainly my problem is only resolved by this.

Delete .Gradle Folder -> Clean->Built

Usman Ali
  • 425
  • 1
  • 9
  • 31
1

Delete the .gradle Folder from root project that showed in the top of the root project.

Vinoj Vetha
  • 726
  • 6
  • 8