In API 21, the command :app:shrinkProdDebugMultiDexComponents not called because API 21 already uses ART instead of Dalvik. Thus, multidexes are initially supported.
For APIs below 21, the command is executed :app:shrinkProdDebugMultiDexComponents . Checking your build.gradle everything looks great, which leads me to the following.
Is multidex support configured correctly?
Have you installed a manifest to support Multidex?
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.android.multidex.myapplication"> <application ... android:name="android.support.multidex.MultiDexApplication"> ... </application> </manifest>
OR, if you really extend the application class, you can do this:
public class MyApplication extends Application { ... @Override protected void attachBaseContext(Context base) { super.attachBaseContext(base); MultiDex.install(this); } ... }
or use this "prebuilt" version
public class MyApplication extends MultiDexApplication{ ... }
Fadils
source share