. Advertisement .
..3..
. Advertisement .
..4..
The error: “AbstractDynamicObject$CustomMessageMissingMethodException error in android” is a common error that can show up in many ways. In this blog, we will go through some of the ways you can fix this issue. Read on.
When Do You Encounter The Error: “AbstractDynamicObject$CustomMessageMissingMethodException error in android”?
When attempting to integrate Firebase into your project, you might get the following error after attempting to connect to Firebase: AbstractDynamicObject$CustomMessageMissingMethodException.
The full stack trace is as follows:
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)
You have encountered the error “AbstractDynamicObject$CustomMessageMissingMethodException error in android” because of Com.google.gms:google-services:4.3.6 version.
How To Solve The Error: “AbstractDynamicObject$CustomMessageMissingMethodException error in android”?
Approach 1: Upgrade Google Services to version 4.3.6
The first method to solve the error “AbstractDynamicObject$CustomMessageMissingMethodException error in android” is upgrading Google Services to version 4.3.6, as well as the following changes (desktop):
- The version of Gradle: 7.0
- 4.2.0 stable version of Android Studio
- Plugin name and version: google-service:4.3.6
After doing that, your error completely disappear.
Approach 2: Follow the steps below
Com.google.gms:google-services:4.3.6 is the issue. If this is the case, the temporary remedy is downgrading Google-Service to 4.3.5 by following the steps below.
- Access the build.gradle file in a text editor.
2. Please downgrade google-service to 4.3.5 in the dependencies. As shown in the example below. Let’s change:
classpath 'com.google.gms:google-services:4.3.6'
to:
classpath 'com.google.gms:google-services:4.3.5'
3. Gradle sync is the next step.
You should be able to get rid of the mistake. For many people, this method worked. Hopefully, this solution was also successful for you.
Approach 3: Upgrade the dependencies
The 3rd approach to fix the error ”AbstractDynamicObject$CustomMessageMissingMethodException error in android” is upgradeing the dependencies. Let’s look at our example below:
This is the detail of our dependencies.
Here is the Android Studio 4.2 which is built on April 28 2021 we run:
repositories {
google()
mavenCentral()
maven { url 'https://plugins.gradle.org/m2/'}
}
dependencies {
classpath 'com.android.tools.build:gradle:4.2.0'
classpath 'com.google.gms:google-services:4.3.5'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.6.0'
classpath 'com.google.firebase:perf-plugin:1.4.0'
Following is Gradle Plugin 4.2.0 Gradle 7.0.1:
//Firebase
implementation 'com.google.firebase:firebase-ads:20.1.0'
implementation 'com.google.firebase:firebase-core:19.0.0'
implementation 'com.google.firebase:firebase-crash:16.2.1'
implementation 'com.google.firebase:firebase-messaging:22.0.0'
implementation 'com.firebase:firebase-jobdispatcher:0.8.5'
implementation 'com.google.firebase:firebase-auth:21.0.0'
implementation 'com.google.firebase:firebase-firestore:23.0.0'
There is problem with the same error in our dependencies. To solve this error, we upgraded dependencies when the error occured and made it narrow to:
classpath 'com.google.gms:google-services:4.3.6'
Replaced it with:
classpath 'com.google.gms:google-services:4.3.5'
After that, the error disappeared. This is also a solution we want to suggest you. Let’s do it to get your desired results.
Conclusion
We hope you enjoyed our article about the error. With this knowledge, we know that you can fix your issue: “AbstractDynamicObject$CustomMessageMissingMethodException error in android” quickly by following these steps! If you still have any other questions about fixing this syntax error, please leave a comment below. Thank you for reading!
Read more
Leave a comment