// Top-level build file where you can add configuration options common to all sub-projects/modules. allprojects { repositories { jcenter() } } project.ext.preDexLibs = !project.hasProperty('disablePreDex') subprojects { project.plugins.whenPluginAdded { plugin -> if ("com.android.build.gradle.AppPlugin".equals(plugin.class.name)) { project.android.dexOptions.preDexLibraries = rootProject.ext.preDexLibs } else if ("com.android.build.gradle.LibraryPlugin".equals(plugin.class.name)) { project.android.dexOptions.preDexLibraries = rootProject.ext.preDexLibs } } }