gpt4 book ai didi

android - 找不到 Gradle DSL 方法 : 'multiDexEnabled()'

转载 作者:塔克拉玛干 更新时间:2023-11-02 19:19:49 26 4
gpt4 key购买 nike

我遵循了 https://developer.android.com/tools/building/multidex.html 的 multidex 指南

但我收到此错误 Gradle DSL method not found : 'multiDexEnabled()' 。我更新了 Android Built Tools 、Android Support Repository 和 Library。这是我的 gradle.build 文件。我在这里做错了什么吗?

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'
}

最佳答案

当我将 multiDexEnabled true 命令放在错误的位置时,我也收到了这个错误。确保它在 defaultConfig 代码块中:

android {
...

defaultConfig {
...

// Enabling multidex support.
multiDexEnabled true
}
}

关于android - 找不到 Gradle DSL 方法 : 'multiDexEnabled()' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26908228/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com