On Updating Android Stdio,Error:Execution Failed For Task ':app:dexDebug'. > Com.android.ide.common.process.ProcessException:
Solution 1:
dependencies {
...
// add this since you are using minSdkVersion less than 21
compile 'com.android.support:multidex:1.0.1'
}
and set multiDexEnabled to true in defaultConfig like this
defaultConfig {
applicationId "com.shubham.MeraIndore"
minSdkVersion 12
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
}
You also need to reference the MultiDexApplication class in your manifest by adding android:name="android.support.multidex.MultiDexApplication" to application tag.
Note: If instead, your app extends the Application class, you can override the attachBaseContext() method and call MultiDex.install(this) to enable multidex, like this.
@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(this);
}
Solution 2:
it always happens because you enabled multiDex for release builds only, not for debug builds.
Try this:
defaultConfig {
multiDexEnabled true
}
Solution 3:
One of the causes for this is when you reach the 65K method limit. You can solve this by either removing unused code/libraries. For that you need to have a look at your dependencies. To list your dependencies you can execute
gradlew -q dependencies app:dependencies --configuration compile
command in your project's root directory.
Or if there are no code/libraries to remove, you can use multidex support
dependencies {
...
// add this since you are using minSdkVersion less than 21
compile 'com.android.support:multidex:1.0.1'
}
and set multiDexEnabled
to true in defaultConfig
like this
defaultConfig {
applicationId "com.shubham.MeraIndore"
minSdkVersion 12
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
}
You also need to reference the MultiDexApplication
class in your manifest by adding android:name="android.support.multidex.MultiDexApplication"
to application tag.
Note: If instead, your app extends the Application
class, you can override the attachBaseContext()
method and call MultiDex.install(this)
to enable multidex, like this.
@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(this);
}
Solution 4:
You seem to use different versions of the Android support library (23.0.1 and 23.1.1). Maybe you should try to use the same version.
Also, as suggested before, list your dependencies to check that they use the same versions as you of the support library:
./gradlew app:dependencies --configuration compile
Post a Comment for "On Updating Android Stdio,Error:Execution Failed For Task ':app:dexDebug'. > Com.android.ide.common.process.ProcessException:"