I have upgraded to Android Studio 2.1 and I got this error while I am trying to build & run my corporate big project:
Execution failed for task \
Step1: Change build.grade
defaultConfig {
...
// Enabling multidex support.
multiDexEnabled true
}
dependencies {
...
compile 'com.android.support:multidex:1.0.0'
}
Step2: Setting on the Application class
public class MyApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
MultiDex.install(this);
}
}
Step3: Change grade.properties
org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
It will work!. Thanks.