8

when I use gradle(version 2.1 or 2.4) building Android Project, get the error below. I can not find com.android.support:multidex:1.0.1 in my files.

ERRORS:

config is set to BF688C717A5C3A69FE8CA522643C0A68
config is set to PRODUCT
vcode is set to 151
vname is set to 1.5.1

FAILURE: Build failed with an exception.

* What went wrong:

A problem occurred configuring project ':XXXX'.

 Could not resolve all dependencies for configuration 

':yizhangtong:_rendepeng_lmDebugCompile'.

    Could not find com.android.support:multidex:1.0.1.

     Searched in the following locations:

.............

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 30.178 secs
Wesley
  • 4,084
  • 6
  • 37
  • 60
stackvoid
  • 117
  • 1
  • 2
  • 9
  • Did you find a fix for this? Apparently I am having similar issue with gradle 2.5 – Syed Ali Sep 01 '15 at 15:12
  • download android-sdk again(not update), could solve this problem. – stackvoid Sep 23 '15 at 01:47
  • 1
    Find sdk location and multidex path like this; "\android-sdk\extras\android\m2repository\com\android\support\multidex". You'll see versions already downloaded. just use last version. If still gets same error, check your sdk location. – kaya Oct 30 '16 at 11:40

6 Answers6

18

You need to install "Android Support Repository" from the Android SDK manager. (a.k.a extra-android-m2repository if installing from the command line)

**OR**

You need to install "Android Support Library(Obsolete)" from the Android SDK manager.

CTN
  • 335
  • 1
  • 18
chetbox
  • 1,732
  • 19
  • 19
8

This issue exists in Android studio Beta versions The only solution is to use

repositories {
    maven {
        url 'https://maven.google.com'
    }
}

in project gradle file

Ahmad Arslan
  • 4,498
  • 8
  • 38
  • 59
0

Installing both Android Support Library and Local Maven Repository for Support Libraries from the Android SDK manager (Extras section) fixed this issue for me.

Vyacheslav Orlovsky
  • 329
  • 1
  • 6
  • 15
0

If you are using Android SDK command line tools, type:

sdkmanager "extras;android;m2repository"

The SDK manager will install the m2 repository

Raymond Chiu
  • 934
  • 9
  • 15
-1

try compile 'com.android.support:multidex:1.0.0'

souttab
  • 696
  • 6
  • 12
-1

I fixed it by adding google() in allprojects node on top-level build.gradle file. Here is my top level file for reference

buildscript {
    repositories {
        jcenter()
          mavenLocal()
          google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.0'
    }
}

allprojects {
    repositories {
        jcenter()
        google()
    }
}