无法解决:multidex
打开文件
同步项目时发现此错误。
apply plugin: 'com.android.library'
android {
compileSdkVersion rootProject.compileSdkVersion
buildToolsVersion rootProject.buildToolsVersion
defaultConfig {
minSdkVersion 16
targetSdkVersion rootProject.targetSdkVersion
versionCode 1
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
def system_dependencies = rootProject.ext.system_dependencies
compile system_dependencies.appcompat_v7
testCompile 'junit:junit:4.12'
}
我添加了它,但是它不起作用。
maven {
url 'https://maven.google.com'
}
我尝试了很多方法。如何解决?
最佳答案
在项目build.gradle中
allprojects {
repositories {
/**
* This must be at the top.
*/
maven {
url 'https://maven.google.com'
}
// Others
maven { url "..." }
jcenter()
mavenCentral()
google()
}
}
关于android - Android Studio无法解决:multidex打开文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53038570/