找不到 Gradle DSL 方法:'multiDexEnabled()' [英] Gradle DSL method not found : 'multiDexEnabled()'
问题描述
我遵循了 https://developer.android.com/tools/上的 multidex 指南建筑/multidex.html
但我收到此错误 Gradle DSL method not found : 'multiDexEnabled()' .我已经更新了 Android 内置工具、Android 支持存储库和库.这是我的 gradle.build 文件.我在这里做错了吗?
But I get this error Gradle DSL method not found : 'multiDexEnabled()' . I have updated Android Built Tools , Android Support Repository and Library. Here is my gradle.build file. Am I doing something wrong here?
Could not find method multiDexEnabled() for arguments [true] on ProductFlavorDsl_Decorated{name=main, minSdkVersion=ApiVersionImpl{mApiLevel=10, mCodename='null'}, targetSdkVersion=ApiVersionImpl{mApiLevel=17, mCodename='null'}, renderscriptTargetApi=-1, renderscriptSupportMode=null, renderscriptNdkMode=null, versionCode=-1, versionName=null, applicationId=test.com.app, testApplicationId=null, testInstrumentationRunner=null, testHandleProfiling=null, testFunctionalTest=null, signingConfig=null, resConfig=null}.
build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 19
buildToolsVersion "21.1.1"
defaultConfig {
applicationId "test.com.app"
minSdkVersion 10
targetSdkVersion 17
// Enabling multidex support.
multiDexEnabled true
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile project(':addThisSDK')
compile project(':centeredContentButton')
compile project(':googleplayservices_lib')
compile files('libs/addthis0.0.8.jar')
compile files('libs/adxtag2.4.6.jar')
compile files('libs/android-support-v4.jar')
compile files('libs/aws-android-sdk-1.7.1.1-debug.jar')
compile files('libs/commons-lang-2.6.jar')
compile files('libs/crittercism_v4_4_0_sdkonly.jar')
compile files('libs/dd-plist.jar')
compile files('libs/FiksuAndroidSDK_4.1.1.jar')
compile files('libs/iqengines-sdk-barcode.jar')
compile files('libs/irEventTracker-1.2.jar')
compile files('libs/jolt-core-0.0.7.jar')
compile files('libs/json-utils-0.0.7.jar')
compile files('libs/jsoup-1.7.2.jar')
compile files('libs/kooaba-api-v4-java.jar')
compile files('libs/signpost-commonshttp4-1.2.1.1.jar')
compile files('libs/signpost-core-1.2.1.1.jar')
compile 'com.android.support:multidex:1.0.0'
}
推荐答案
您必须运行 0.14.0 或更高版本的 Android Gradle 插件.请参阅 http://tools.android.com/tech-docs/上的发行说明new-build-system 详细了解每个版本的内容.
You have to be running version 0.14.0 or later of the Android Gradle plugin. See the release notes at http://tools.android.com/tech-docs/new-build-system for details on what's in each release.
这篇关于找不到 Gradle DSL 方法:'multiDexEnabled()'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!