错误:Multi dex需要Build Tools版本

时间:2022-03-16 20:50:05

I just updated my android studio and i'm getting this error:

我刚刚更新了我的android工作室,我收到了这个错误:

Error:Execution failed for task
':app:transformClassesWithDexForDebug'.
com.android.build.api.transform.TransformException:
java.lang.RuntimeException:
com.android.ide.common.process.ProcessException:
java.util.concurrent.ExecutionException:
java.lang.IllegalStateException: Multi dex requires Build Tools 21.0.0
/ Current: 19.1

6 个解决方案

#1


33  

Here are the couple of things which you can solve the problem.

以下是您可以解决问题的几件事。

  1. Change the USB computer connection to Camera(PTP) from Media device(MTP) in your smart phone

    从智能手机中的媒体设备(MTP)更改USB计算机与相机(PTP)的连接

  2. Change the Build version to 21.1.2 in build.gradle(Module: app)

    在build.gradle中将Build版本更改为21.1.2(Module:app)

    错误:Multi dex需要Build Tools版本

  3. Make sure that Android SDK build tools [build-tool;21.1.2] is installed otherwise install it

    确保已安装Android SDK构建工具[build-tool; 21.1.2],否则请安装它

    错误:Multi dex需要Build Tools版本

  4. After this just run the project.

    在此之后运行该项目。

#2


6  

A bit old question but I hope you overcome from your problem.

有点老问题,但我希望你克服你的问题。

Today I updated my Android Studio to version 2.1 and, and the buildToolVersion to the latest 23.0.3 (as of 8th,May,2016)

今天我将Android Studio更新为2.1版,将buildToolVersion更新为最新版本23.0.3(截至2016年5月8日)

The issue you faced happened to me today as well in one of my project and as it described in your error log too, the project built tool is older than the current.

你今天遇到的问题也发生在我的一个项目中,正如你在错误日志中描述的那样,项目构建的工具比当前更早。

So, if you raise your build tool to the at least the min required or higher, you can successfully build your project.

因此,如果将构建工具提升到至少所需的最小值或更高,则可以成功构建项目。

To do that, open your build.gradle(Module:app), configure it similar to following:

为此,打开build.gradle(Module:app),配置类似于以下内容:

android {
compileSdkVersion 23
buildToolsVersion "23.0.3"

defaultConfig {
    applicationId "com.yoursite.yourapp"
    minSdkVersion 14
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
}

Hope it helps to others as well.

希望它对其他人也有帮助。

#3


2  

Changing buildToolsVersion to 21.1.2 works very well for me. Every time I update Android Studio, I get new errors.

将buildToolsVersion更改为21.1.2对我来说非常有效。每次我更新Android Studio时,都会出现新的错误。

#4


0  

For me, changing the buildToolsVersion from "24.0.0 rc3" to "21.1.2" fixed the issue. This is in the build.gradle (Module: app) file.

对我来说,将buildToolsVersion从“24.0.0 rc3”更改为“21.1.2”解决了这个问题。这是在build.gradle(Module:app)文件中。

#5


0  

I recently read this answer in SO

我最近在SO中读到了这个答案

For me the problem was solved after I removed jar file from my project. it seems that one of the jar files inside my project was using an older version of google play services.

对我来说,从我的项目中删除jar文件后,问题就解决了。似乎我项目中的一个jar文件使用的是旧版本的google play服务。

#6


0  

I faced a similar issue and i did 3 workarounds. I don't know which one fixed the issue. Or may be all of them.

我遇到了类似的问题,我做了3个解决方法。我不知道哪一个解决了这个问题。或者可能都是他们。

  1. I have java library module. it depends on some jars. I removed unnecessary jars.
  2. 我有java库模块。这取决于一些罐子。我删除了不必要的罐子。
  3. I extracted code from inside the java library module and added it directly to my app and removed the java library module.
  4. 我从java库模块中提取代码并将其直接添加到我的应用程序并删除了java库模块。
  5. I added these lines to my gradle file:

    我将这些行添加到我的gradle文件中:

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_7
        targetCompatibility JavaVersion.VERSION_1_7
    }
    

#1


33  

Here are the couple of things which you can solve the problem.

以下是您可以解决问题的几件事。

  1. Change the USB computer connection to Camera(PTP) from Media device(MTP) in your smart phone

    从智能手机中的媒体设备(MTP)更改USB计算机与相机(PTP)的连接

  2. Change the Build version to 21.1.2 in build.gradle(Module: app)

    在build.gradle中将Build版本更改为21.1.2(Module:app)

    错误:Multi dex需要Build Tools版本

  3. Make sure that Android SDK build tools [build-tool;21.1.2] is installed otherwise install it

    确保已安装Android SDK构建工具[build-tool; 21.1.2],否则请安装它

    错误:Multi dex需要Build Tools版本

  4. After this just run the project.

    在此之后运行该项目。

#2


6  

A bit old question but I hope you overcome from your problem.

有点老问题,但我希望你克服你的问题。

Today I updated my Android Studio to version 2.1 and, and the buildToolVersion to the latest 23.0.3 (as of 8th,May,2016)

今天我将Android Studio更新为2.1版,将buildToolVersion更新为最新版本23.0.3(截至2016年5月8日)

The issue you faced happened to me today as well in one of my project and as it described in your error log too, the project built tool is older than the current.

你今天遇到的问题也发生在我的一个项目中,正如你在错误日志中描述的那样,项目构建的工具比当前更早。

So, if you raise your build tool to the at least the min required or higher, you can successfully build your project.

因此,如果将构建工具提升到至少所需的最小值或更高,则可以成功构建项目。

To do that, open your build.gradle(Module:app), configure it similar to following:

为此,打开build.gradle(Module:app),配置类似于以下内容:

android {
compileSdkVersion 23
buildToolsVersion "23.0.3"

defaultConfig {
    applicationId "com.yoursite.yourapp"
    minSdkVersion 14
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
}

Hope it helps to others as well.

希望它对其他人也有帮助。

#3


2  

Changing buildToolsVersion to 21.1.2 works very well for me. Every time I update Android Studio, I get new errors.

将buildToolsVersion更改为21.1.2对我来说非常有效。每次我更新Android Studio时,都会出现新的错误。

#4


0  

For me, changing the buildToolsVersion from "24.0.0 rc3" to "21.1.2" fixed the issue. This is in the build.gradle (Module: app) file.

对我来说,将buildToolsVersion从“24.0.0 rc3”更改为“21.1.2”解决了这个问题。这是在build.gradle(Module:app)文件中。

#5


0  

I recently read this answer in SO

我最近在SO中读到了这个答案

For me the problem was solved after I removed jar file from my project. it seems that one of the jar files inside my project was using an older version of google play services.

对我来说,从我的项目中删除jar文件后,问题就解决了。似乎我项目中的一个jar文件使用的是旧版本的google play服务。

#6


0  

I faced a similar issue and i did 3 workarounds. I don't know which one fixed the issue. Or may be all of them.

我遇到了类似的问题,我做了3个解决方法。我不知道哪一个解决了这个问题。或者可能都是他们。

  1. I have java library module. it depends on some jars. I removed unnecessary jars.
  2. 我有java库模块。这取决于一些罐子。我删除了不必要的罐子。
  3. I extracted code from inside the java library module and added it directly to my app and removed the java library module.
  4. 我从java库模块中提取代码并将其直接添加到我的应用程序并删除了java库模块。
  5. I added these lines to my gradle file:

    我将这些行添加到我的gradle文件中:

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_7
        targetCompatibility JavaVersion.VERSION_1_7
    }