I am facing an issue with firebase getInstanceId() in existing project.here is the full error and the dependencies I am using.
java.lang.NoSuchMethodError: No virtual method getInstanceId()Lcom/google/android/gms/tasks/Task; in class Lcom/google/firebase/iid/FirebaseInstanceId; or its super classes (app/com.xx.xxx.staging.dev-2/split_lib_dependencies_apk.apk)
Error occurs on this line
MixpanelAPI mixpanel =
                MixpanelAPI.getInstance(context, BuildConfig.MIXPANEL_TOKEN);
module - build.gradle
buildscript {
repositories {
    mavenCentral()
    jcenter()
    google()
    maven { url 'https://maven.fabric.io/public' }
    maven {url "https://clojars.org/repo/"}
}
dependencies {
    classpath 'com.android.tools.build:gradle:3.0.1'
    classpath "com.fernandocejas.frodo:frodo-plugin:0.8.1"
    classpath 'me.tatarka:gradle-retrolambda:3.2.3'
    classpath "io.realm:realm-gradle-plugin:3.5.0"
    classpath 'com.google.gms:google-services:3.2.1' // google-services plugin
}
}
    android {
        compileSdkVersion 27
        buildToolsVersion '27.0.0'
        compileOptions {
            sourceCompatibility JavaVersion.VERSION_1_8
            targetCompatibility JavaVersion.VERSION_1_8
        }
        defaultConfig {
            applicationId "com.xx.xxx"
            minSdkVersion 21
            targetSdkVersion 27
    dependencies {
    implementation 'com.google.firebase:firebase-messaging:15.0.0'
    }
    apply plugin: 'com.google.gms.google-services'
project build.gradle
buildscript {
    repositories {
        jcenter()
        google()
        maven { url 'http://repo1.maven.org/maven2' }
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.1'
       // classpath "io.realm:realm-gradle-plugin:3.0.0"
       // classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
        classpath "com.fernandocejas.frodo:frodo-plugin:0.8.1"
        classpath 'com.frogermcs.androiddevmetrics:androiddevmetrics-plugin:0.4'
        classpath 'com.google.gms:google-services:3.2.0'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}
could you please suggest am I missing anything here?
thanks R