Reputation: 286
I am getting this error while i run program in the Android studio.. There is no anyother is here i guess.
Error:Execution failed for task ':app:createDebugMainDexClassList'.
com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files (x86)\Java\jdk1.7.0_06\bin\java.exe'' finished with non-zero exit value 1
Here it is my gradle file copy..
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.1"
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "app.example.com"
minSdkVersion 14
targetSdkVersion 25
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
lintOptions { abortOnError false }
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile files('libs/socialauth-4.9.jar')
compile 'com.android.support:recyclerview-v7:+'
compile project(':linkedin-sdk')
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'org.lucasr.twowayview:twowayview:0.1.4'
compile 'de.hdodenhof:circleimageview:1.2.1'
compile 'com.android.support:appcompat-v7:+'
compile 'com.android.support:design:+'
compile 'com.google.android.gms:play-services:7.3.0'
compile 'com.android.support:multidex:1.0.1'
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
compile ('org.apache.httpcomponents:httpmime:4.3.5')
{
exclude group: 'org.apache.httpcomponents', module: 'httpclient'
}
}
what's the issue ?
Upvotes: 0
Views: 636
Reputation: 492
its seems to be multidex issue. just add maximum heap size and multidex library dependency.
android {
dexOptions {
incremental = true;
preDexLibraries = false
javaMaxHeapSize "4g"
}
}
defaultConfig {
multiDexEnabled true
}
also put Dependency
compile 'com.android.support:multidex:1.0.0'
you will also need to extend your application class to MultiDexApplication
public class App extends MultiDexApplication {
@Override
public void onCreate()
{
super.onCreate();
// Initialize
}
@Override
protected void attachBaseContext(Context base)
{
super.attachBaseContext(base);
MultiDex.install(this);
}
}
Don't forgot to make an entry of app class in manifest.
Upvotes: 1
Reputation: 1894
Use this in app build.gradle worked for me
defaultConfig {
// Enabling multidex support.
multiDexEnabled true
}
Upvotes: 0