Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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
like image 378
stackvoid Avatar asked Jul 08 '15 03:07

stackvoid


People also ask

How do I enable multidex support?

To enable Multidex, edit the build. gradle file at the module level: android { compileSdk 31 defaultConfig { ... minSdk 21 targetSdk 31 versionCode 1 versionName "1.0" multiDexEnabled true // Add this to enable Multidex testInstrumentationRunner "androidx.

What is multidex application Android?

In Android, the compilers convert your source code into DEX files. This DEX file contains the compiled code used to run the app. But there is a limitation with the DEX file. The DEX file limits the total number of methods that can be referenced within a single DEX file to 64K i.e. 65,536 methods.

How do I enable multidex in flutter project?

How do I enable multidex in flutter project? The multidex support is enabled automatically. If your app supports Android SDK versions below 21, and it exceeds the 64K method limit, simply pass the –multidex flag to flutter build appbundle or flutter build apk and your app will support multidex.


2 Answers

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.

like image 107
chetbox Avatar answered Nov 15 '22 21:11

chetbox


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

like image 33
Ahmad Arslan Avatar answered Nov 15 '22 22:11

Ahmad Arslan