🙃

【Flutter】CustomMessageMissingMethodException の対処法

2021/05/17に公開

build.gradle'com.google.gms:google-services:4.3.6'を追加して実行すると、以下のエラーが発生しました。

build.gradle

dependencies {
    classpath 'com.android.tools.build:gradle:4.1.0'
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    classpath 'com.google.gms:google-services:4.3.6'
}

エラーメッセージ

* What went wrong:                                                      
A problem occurred evaluating root project 'android'.                   
> A problem occurred configuring project ':app'.                        
   > Failed to notify project evaluation listener.                      
      > 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.
      > KotlinJvmAndroidCompilation with name 'debug' not found.        
                                                                        
* Try:                                                                  
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

対処法

'com.google.gms:google-services:4.3.6'4.3.5にすると解決しました。

Discussion