Skip to content
Home » AbstractDynamicObject$CustomMessageMissingMethodException error

AbstractDynamicObject$CustomMessageMissingMethodException error

To solve AbstractDynamicObject$CustomMessageMissingMethodException error follow below methods. While trying to build a project I got the following error:

Could not parse the Android application Module’s Gradle Config.

So I checked my build and saw that jCenter() was deprecated and that I should remove it. Everything functioned perfectly after I removed it. However, when I attempted to connect to Firebase, I received the following error:

ERROR LOG

Caused by: java.lang.RuntimeException: com.android.build.gradle.internal.crash.ExternalApiUsageException: org.gradle.internal.metaobject.AbstractDynamicObject$CustomMessageMissingMethodException: Could not find method setVariantDir() for arguments [debug] on task ':app:processDebugGoogleServices' of type com.google.gms.googleservices.GoogleServicesTask.
    at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:71)
    at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:54)
    at com.android.build.gradle.internal.profile.AnalyticsResourceManager.recordBlockAtConfiguration(AnalyticsResourceManager.kt:206)
    at com.android.build.gradle.internal.profile.AnalyticsConfiguratorService.recordBlock(AnalyticsConfiguratorService.kt:85)
    at com.android.build.gradle.internal.plugins.BasePlugin.lambda$createTasks$9(BasePlugin.java:582)
    at com.android.build.gradle.internal.crash.CrashReporting$afterEvaluate$1.execute(crash_reporting.kt:37)
    at com.android.build.gradle.internal.crash.CrashReporting$afterEvaluate$1.execute(crash_reporting.kt)

How to solve AbstractDynamicObject$CustomMessageMissingMethodException error ?

The issue is com.google.gms:google-services:4.3.6, so the solution for now is to downgrade google-service to 4.3.5 by following the steps below. Launch the build.gradle file. Please downgrade google-service to 4.3.5 in the dependencies. As shown below.

Fortunately, I was changing dependencies at the time, so I was able to limit it down to:

classpath 'com.google.gms:google-services:4.3.6'

Change it to

classpath 'com.google.gms:google-services:4.3.5'

Alternative to Solve AbstractDynamicObject$CustomMessageMissingMethodException error

The error is because of the classpath 'com.google.gms:google-services:4.3.6'

Go back to version 4.3.5

dependencies {
        classpath 'com.google.gms:google-services:4.3.5'
}

Instead of 4.3.6

dependencies {
        classpath 'com.google.gms:google-services:4.3.6'
}

Update : Google had fixed the problem in version 4.3.8 (Release Notes)

An updated version of the google-services plugin for Android (v4.3.8) is now available.

Hope the above solution works.

Also read :

HTTPError: HTTP Error 404: Not Found in Pytube