简体   繁体   English

我如何修复项目同步失败并在 android studio 3.2 中出现“无法解决:multidex”错误

[英]How do i fix project sync failed with "Failed to resolve: multidex" error in android studio 3.2

I am trying to load a project into android studio.我正在尝试将一个项目加载到 android studio 中。 I have to work on from gitlab .我必须从gitlab开始工作。 But when the project is loaded to android studio I am getting this error.但是当项目加载到 android studio 时,我收到了这个错误。

Failed to resolve: multidex无法解决:multidex 在此处输入图片说明

and project sync fails.并且项目同步失败。 I have tried googling for some fixes.我试过谷歌搜索一些修复。 but unfortunately I was not able to find any valid results.但不幸的是我找不到任何有效的结果。

why this happening and how can i fix it?为什么会发生这种情况,我该如何解决?

Add below line in your dependencies在您的依赖项中添加以下行

implementation 'com.android.support:multidex:1.0.3'

I hope this will help you我希望这能帮到您

Place google() before jcenter() in the allprojects of build.gradlejcenter() google() jcenter() google()之前

allprojects {
    repositories {
        google()
        jcenter()
        maven { url "https://maven.google.com" }
    }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM