title: Conflict between Firebase in app messaging ( implementation 'com.google.firebase:firebase-inappmessaging-display:19.1.5') and gRPC in Android
body: <p>I was going to implement Firebase in-app messaging functionality in my  Android application that uses gRPC server. However when  I put a dependency  for Firebase in-app messaging  (<strong>implementation 'com.google.firebase:firebase-inappmessaging-display:19.1.5</strong> ) I got  a  strange  error that is related to gRPC. I am assuming that this error  happened because  of gRPC version conflict. So can anyone help to solve this issue?</p>
  <p>App level  build.gradle file:</p>
  <hr />
  <pre><code>apply plugin: 'com.android.application'
  apply plugin: 'com.google.protobuf'
  apply plugin: 'com.google.gms.google-services'
  apply plugin: 'kotlin-android'
  apply plugin: 'kotlin-kapt'
  
  android {
      compileSdkVersion 30
      buildToolsVersion &quot;30.0.3&quot;
  
      dataBinding {
          enabled = true
      }
  
      defaultConfig {
          applicationId &quot;com.nsl_moca&quot;
          minSdkVersion 26
          targetSdkVersion 30
          versionCode 12
          versionName &quot;1.1.12&quot;
          testInstrumentationRunner &quot;androidx.test.runner.AndroidJUnitRunner&quot;
          vectorDrawables.useSupportLibrary = true
      }
  
      buildFeatures {
      }
  
      buildTypes {
          release {
              shrinkResources false
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
          }
      }
      compileOptions {
          sourceCompatibility JavaVersion.VERSION_1_8
          targetCompatibility JavaVersion.VERSION_1_8
      }
      kotlinOptions {
          jvmTarget = &quot;1.8&quot;
          useIR = true
      }
      packagingOptions {
          exclude 'META-INF/DEPENDENCIES'
          exclude 'META-INF/LICENSE'
          exclude 'META-INF/LICENSE.txt'
          exclude 'META-INF/license.txt'
          exclude 'META-INF/NOTICE'
          exclude 'META-INF/NOTICE.txt'
          exclude 'META-INF/notice.txt'
          exclude 'META-INF/ASL2.0'
      }
      kotlinOptions {
          jvmTarget = '1.8'
          useIR = true
      }
      buildFeatures {
      }
      composeOptions {
          kotlinCompilerVersion '1.4.30'
      }
  
  }
       protobuf {
      protoc { artifact = 'com.google.protobuf:protoc:3.12.0' }
      plugins {
          javalite { artifact = &quot;com.google.protobuf:protoc-gen-javalite:3.0.0&quot; }
          grpc { artifact = 'io.grpc:protoc-gen-grpc-java:1.37.0' }
      }
      generateProtoTasks {
          all().each { task -&gt;
              task.plugins {
                  javalite {}
                  grpc { option 'lite' }
              }
          }
      }
  
      dependencies {
          implementation 'com.google.firebase:firebase-inappmessaging-display:19.1.5'
          implementation 'com.google.android.material:material:1.4.0-alpha01'
          implementation 'androidx.navigation:navigation-fragment-ktx:2.3.4'
          implementation 'androidx.navigation:navigation-ui-ktx:2.3.4'
          implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0'
          implementation 'com.github.prolificinteractive:material-calendarview:2.0.0'
          implementation 'com.evrencoskun.library:tableview:0.8.9.2'
          implementation 'androidx.recyclerview:recyclerview:1.2.0'
          implementation fileTree(include: ['*.jar'], dir: 'libs')
          implementation 'androidx.appcompat:appcompat:1.2.0'
          implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
          implementation 'androidx.cardview:cardview:1.0.0'
          implementation 'com.koushikdutta.ion:ion:2.1.6'
          implementation files('libs/accessory-v2.6.1.jar')
          implementation files('libs/sdk-v1.0.0.jar')
          implementation 'com.google.android.gms:play-services-auth:19.0.0'
          implementation('com.google.apis:google-api-services-drive:v3-rev136-1.25.0') { exclude group: 'org.apache.httpcomponents' }
          implementation('com.google.http-client:google-http-client-gson:1.26.0') { exclude group: 'org.apache.httpcomponents' }
          implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.3.0'
          implementation &quot;org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version&quot;
          implementation 'androidx.legacy:legacy-support-v4:1.0.0'
          testImplementation 'junit:junit:4.13.2'
          androidTestImplementation 'androidx.test.ext:junit:1.1.2'
          androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
          implementation 'com.opencsv:opencsv:3.9'
          implementation 'org.apache.httpcomponents:httpclient-android:4.3.5.1'
          implementation 'com.jjoe64:graphview:4.2.2'
          implementation('org.apache.httpcomponents:httpmime:4.5.12') { exclude module: &quot;httpclient&quot; }
          implementation('com.omertron:themoviedbapi:4.2') { exclude group: 'org.apache.httpcomponents', module: 'httpclient' exclude module: 'junit' }
          implementation 'com.google.android.gms:play-services-maps:17.0.0'
          implementation 'com.google.android.gms:play-services-location:18.0.0'
          implementation 'io.grpc:grpc-okhttp:1.37.0'
          implementation 'io.grpc:grpc-protobuf-lite:1.37.0'
          implementation 'io.grpc:grpc-stub:1.37.0'
          implementation 'javax.annotation:javax.annotation-api:1.3.2'
          implementation 'com.google.android.material:material:1.3.0'
          implementation 'com.google.mlkit:face-detection:16.0.5'
          implementation files('libs/TarsosDSP-Android-2.0.jar')
          implementation 'com.github.bumptech.glide:glide:4.8.0'
          implementation 'com.google.firebase:firebase-analytics:18.0.3'
          implementation 'com.google.firebase:firebase-messaging:21.1.0'
          implementation 'org.slf4j:slf4j-jdk14:1.7.30'
          implementation 'com.squareup.okhttp3:okhttp:4.8.1'
          implementation 'com.squareup.okhttp3:logging-interceptor:4.8.1'
          implementation 'com.squareup.okhttp3:okhttp-urlconnection:4.8.1'
          implementation files('libs/instagram4j-develop-32d42c0-dirty.jar')
          implementation group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', version: '2.11.2'
          implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.11.2'
          implementation 'commons-codec:commons-codec:1.14'
          implementation platform('com.google.firebase:firebase-bom:26.8.0')
          implementation 'com.google.firebase:firebase-inappmessaging-display'
          implementation 'com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava'
          implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.1'
  
      }
  
  }
  </code></pre>
  <hr />
  <p>Project level build gradle file:</p>
  <pre><code>// Top-level build file where you can add configuration options common to all sub-projects/modules.
  
  buildscript {
      ext {
      }
      ext.kotlin_version = '1.4.31'
      repositories {
          google()
          jcenter()
  
  
      }
      dependencies {
  
          classpath &quot;com.android.tools.build:gradle:4.0.2&quot;
          classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.11'
          classpath 'com.google.gms:google-services:4.3.5'
          classpath &quot;org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.31&quot;
  
  
          // NOTE: Do not place your application dependencies here; they belong
          // in the individual module build.gradle files
      }
  }
  
  allprojects {
      repositories {
          google()
          jcenter()
          maven { url 'https://jitpack.io' }
  
      }
  }
  
  task clean(type: Delete) {
      delete rootProject.buildDir
  }
  </code></pre>
  <hr />
  <p>Error message when I put Firebase In app  messaging  dependency  in  app level  build.gradle file:</p>
  <p><a href="https://i.stack.imgur.com/9cCE6.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9cCE6.jpg" alt="enter image description here" /></a></p>