Could not find method dexcount() for arguments
See original GitHub issueWhen I add dexcount {…} to my app gradle, I get this error:
Error:org.gradle.internal.metaobject.AbstractDynamicObject$CustomMessageMissingMethodException: Could not find method dexcount() for arguments [build_co6u1j4pjvt1t3moujul16v4c$_run_closure1@22294fa4] on project ':app' of type org.gradle.api.Project.
If I remove the dexcount
block then I can build and run the app just fine (it just doesn’t give any dex counts in the output folder).
app gradle file is:
buildscript {
repositories {
mavenCentral() // or jcenter()
}
dependencies {
classpath 'com.getkeepsafe.dexcount:dexcount-gradle-plugin:0.7.2'
}
}
// make sure this line comes *after* you apply the Android plugin
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-android'
apply plugin: 'com.getkeepsafe.dexcount'
//apply plugin: 'kotlin-kapt'
dexcount {
format = "list"
includeClasses = false
includeClassCount = false
includeFieldCount = true
includeTotalMethodCount = false
orderByMethodCount = false
verbose = false
maxTreeDepth = Integer.MAX_VALUE
teamCityIntegration = false
teamCitySlug = null
runOnEachPackage = true
maxMethodCount = 64000
}
android {
signingConfigs {
config {
...
}
}
compileSdkVersion 25
buildToolsVersion "26.0.0"
defaultConfig {
applicationId "com.example.app"
minSdkVersion 23
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
signingConfig signingConfigs.config
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
versionNameSuffix "-debug"
}
}
flavorDimensions "mode"
productFlavors {
free {
dimension "mode"
}
pro {
dimension "mode"
applicationIdSuffix ".pro"
}
}
}
dependencies {
...
}
apply plugin: 'com.google.gms.google-services'
Thanks in advance for any guidance!
Issue Analytics
- State:
- Created 6 years ago
- Comments:8
Top Results From Across the Web
Could not find method apply() for arguments [com.google.gms ...
The problem is that you wrote apply 'com.google.gms.google-services'. instead of apply plugin: 'com.google.gms.google-services'.
Read more >Fix "Error Could not find method implementation() for ...
The main reason for “Could not find method implementation() for arguments [com.android.support:appcompat-v7:26.0.0]”” error is that the Gradle ...
Read more >Enable multidex for apps with over 64K methods
Learn how to enable an app configuration known as multidex, which allows your app to build and read multiple DEX files.
Read more >Dexcount Gradle Plugin
A Gradle plugin to report the number of method references in your APK, AAR, or java module on every build. This helps you...
Read more >Bad Error message with outdated Gradle Wrapper [182439309]
Could not find method dependencyResolutionManagement() for arguments [...] Compare: the error message after fiddling with the Wrapper and trying to build ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Great, thank you - I’ll have a fix shortly. Appreciate your help!
OK - would you please turn it off, put the
dexcount
config block back into your gradle file, then build? If the build succeeds, then I’ll be confident that I know the bug.