我想将 gradle 升级到 2.0.0-beta 或 1.5.0,目前我的 gradle 中有 dex 插件,但即使我删除了它,我仍然遇到同样的错误。我如何正确摆脱 multidex 依赖
Error:Access to the dex task is now impossible, starting with 1.4.0
1.4.0 introduces a new Transform API allowing manipulation of the .class files.
See more information: http://tools.android.com/tech-docs/new-build-system/transform-api
build.gradle More info on multidex
android {
compileSdkVersion 21
buildToolsVersion "21.1.0"
defaultConfig {
...
minSdkVersion 14
targetSdkVersion 21
...
// Enabling multidex support.
multiDexEnabled true
}
...
}
dependencies {
compile 'com.android.support:multidex:1.0.0'
}
Transform API 不会提供太多信息。 有没有什么可以让这项工作或任何示例如何使用转换 api,任何东西?
我知道它适用于 1.3.0,我至少需要 1.5.0
最佳答案
在项目级别build.gradle
,把这个(或任何你需要的版本)
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
}
至于
How do I properly get rid of the multidex dependency?
您需要删除 Gradle 文件中对 multidex 的所有引用,然后同步 Gradle 并清理并重建项目
关于android - 现在无法访问dex任务,如何升级到1.5.0?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36344183/