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

when I use gradle (version 2.1 or 2.4) to create 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 
+6
source share
7 answers

You need to install the “Android Support Repository” from the Android SDK manager. (aka extra-android-m2repository when installing from the command line)

 **OR** 

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

+17
source

This problem exists in beta versions of Android studio. The only solution is to use

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

in gradle project file

+3
source

Installing the Android support library and the local Maven repository for support libraries from the Android SDK Manager (Advanced section) fixed this problem for me.

+1
source

I also used this error. Make sure you update all of your Android studio libraries, plugins, platforms, and sdk tools in the SDK manager. And make sure you are using the latest version (preferably beta strong>) for Android Studio 2.1. He will work after that.

0
source

If you use the SDK command line tools for Android , enter:

 sdkmanager "extras;android;m2repository" 

SDK manager will install m2 repository

0
source

I fixed it by adding google() in allprojects node to the 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() } } 
0
source

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

-1
source

All Articles