How to fix “Unable to start the daemon process” error in IntelliJ IDEA

There is another strange error that encounters from time to time at the start of IntelliJ IDEA. Gradle refuses to sync project with a following text:

error_daemon

I’ve found a good solution for it here, but it is for Eclipse. Some further analysis indicated that problem is actually in the insufficient amount of available RAM. After closing web browser (500 mb RAM to free) and pressing “Try Again” link in IDEA project has synced without any issues.

How to fix “Multiple dex files define” error in IntelliJ IDEA

There is one strange error I have encountered while trying to build an Android application with IntelliJ IDEA. Gradle crashed with a mysterious message: UNEXPECTED TOP-LEVEL EXCEPTION: com.android.dex.DexException: Multiple dex files define. There are several solutions available for Eclipse and several solutions available for IDEA (this one is my favorite), but none of them worked in my case.

This error started to come up after updating IDEA Gradle plugin from 0.6.+ to 0.7.+ (and corresponding Gradle distribution from 1.8 to 1.9). To verify which plugin version you are using, look at the following line in the build.gradle:

dependencies {
classpath 'com.android.tools.build:gradle:0.7.+'
}

Next thing I found during my investigation to solve this error was the folder named “.gradle” in the project dir. Its content actually clarified much. In this folder Gradle kept task artifacts for building process, both 1.8 and 1.9. Somehow it was causing build conflict. Deleting this folder did the trick, Gradle has recreated it with newer artifacts only and that solved the entire problem.

UPD: Today IDEA suggested to migrate my projects to plugin version 0.9.+ and Gradle version 1.11 due to some breaking changes. No errors this time.