Shahnaz Khan Shahnaz Khan - 1 year ago 219
Android Question

Gradle project sync failed for android support multidex library

I am trying to add Multidex library to my project. I added following as dependency in my 'app/build.gradle' -

complie ''

when i try to sync i can see following error

Error:Could not find method complie() for arguments [] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
Please install the Android Support Repository from the Android SDK Manager.

i have Android Support Repository installed.

SDK Manager snapshot

Can someone help me? Thanks in Advance.

Answer Source

add multiDexEnabled = true in your build.gradle

android {
defaultConfig {
    multiDexEnabled = true

dependencies {
  compile ''

add this to manifest file


and your Activity class

    protected void attachBaseContext(Context base) {
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download