本文介绍了Android Studio无法解决:multidex打开文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
无法解决:multidex打开文件
Failed to resolve: multidexOpen File
我同步项目时发现此错误.
I found this error when I sync my project.
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'
}
我添加了它,但是它不起作用;
I add this, but it dose not work;
maven {
url 'https://maven.google.com'
}
我尝试了很多方法.如何解决?
I try many ways.How to solve it?
推荐答案
在项目build.gradle
In the project build.gradle
allprojects {
repositories {
/**
* This must be at the top.
*/
maven {
url 'https://maven.google.com'
}
// Others
maven { url "..." }
jcenter()
mavenCentral()
google()
}
}
这篇关于Android Studio无法解决:multidex打开文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!