title: java.lang.RuntimeException: Unable to instantiate service com.samriddh.partner.java.MyFirebaseMessagingService
body: <p>I am using Firebase messaging and when I got notification from firebase console my application shutdown with this exception
  can anyone please suggest me what should I have to do i am fighting with this issue for more than 2 hours now</p>
  <p>My firebase messagin version is <code>firebase_messaging: ^6.0.16</code></p>
  <p>My dependendency for the firebaseMessaging is <code>implementation 'com.google.firebase:firebase-messaging:20.2.3'</code></p>
  <blockquote>
  <p>java.lang.RuntimeException: Unable to instantiate service com.samriddh.partner.java.MyFirebaseMessagingService: java.lang.ClassNotFoundException: Didn't find class &quot;com.samriddh.partner.java.MyFirebaseMessagingService&quot; on path: DexPathList[[zip file &quot;/system/framework/org.apache.http.legacy.boot.jar&quot;, zip file &quot;/data/app/com.samriddh.partner-ameKbTimiGALFObiP3aUeg==/base.apk&quot;],nativeLibraryDirectories=[/data/app/com.samriddh.partner-ameKbTimiGALFObiP3aUeg==/lib/arm64, /data/app/com.samriddh.partner-ameKbTimiGALFObiP3aUeg==/base.apk!/lib/arm64-v8a, /system/lib64]]</p>
  </blockquote>
  <p>My android Manifest.xml file is</p>
  <pre><code>&lt;manifest xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
      package=&quot;com.samriddh.partner&quot;&gt;
      &lt;!-- io.flutter.app.FlutterApplication is an android.app.Application that
           calls FlutterMain.startInitialization(this); in its onCreate method.
           In most cases you can leave this as-is, but you if you want to provide
           additional functionality it is fine to subclass or reimplement
           FlutterApplication and put your custom class here. --&gt;
           &lt;uses-permission android:name=&quot;android.permission.INTERNET&quot;/&gt;
          &lt;uses-permission android:name=&quot;android.permission.ACCESS_COARSE_LOCATION&quot; /&gt;
      &lt;application
          android:name=&quot;.Application&quot;
          android:label=&quot;samriddh partner&quot;
          android:icon=&quot;@mipmap/launcher_icon&quot;&gt;
          &lt;activity
              android:name=&quot;.MainActivity&quot;
              android:launchMode=&quot;singleTop&quot;
              android:theme=&quot;@style/LaunchTheme&quot;
              android:configChanges=&quot;orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode&quot;
              android:hardwareAccelerated=&quot;true&quot;
              android:windowSoftInputMode=&quot;adjustResize&quot;&gt;
              &lt;!-- Specifies an Android theme to apply to this Activity as soon as
                   the Android process has started. This theme is visible to the user
                   while the Flutter UI initializes. After that, this theme continues
                   to determine the Window background behind the Flutter UI. --&gt;
              &lt;meta-data
                android:name=&quot;io.flutter.embedding.android.NormalTheme&quot;
                android:resource=&quot;@style/NormalTheme&quot;
                /&gt;
              &lt;!-- Displays an Android View that continues showing the launch screen
                   Drawable until Flutter paints its first frame, then this splash
                   screen fades out. A splash screen is useful to avoid any visual
                   gap between the end of Android's launch screen and the painting of
                   Flutter's first frame. --&gt;
              &lt;meta-data
                android:name=&quot;io.flutter.embedding.android.SplashScreenDrawable&quot;
                android:resource=&quot;@drawable/launch_background&quot;
                /&gt;
            &lt;intent-filter&gt;
                  &lt;action android:name=&quot;FLUTTER_NOTIFICATION_CLICK&quot; /&gt;
                  &lt;category android:name=&quot;android.intent.category.DEFAULT&quot; /&gt;
            &lt;/intent-filter&gt;
            &lt;intent-filter&gt;
                &lt;action android:name=&quot;android.intent.action.MAIN&quot;/&gt;
                &lt;category android:name=&quot;android.intent.category.LAUNCHER&quot;/&gt;
            &lt;/intent-filter&gt;
          &lt;/activity&gt;
  
          &lt;meta-data android:name=&quot;com.google.android.geo.API_KEY&quot;
            android:value=&quot;xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&quot;/&gt;
  
          &lt;uses-library android:name=&quot;org.apache.http.legacy&quot; android:required=&quot;false&quot;/&gt;
          
          &lt;meta-data android:name=&quot;flutterEmbedding&quot; android:value=&quot;2&quot; /&gt;
          
          &lt;service android:name=&quot;.service.MyFirebaseMessagingService&quot;&gt; &lt;/service&gt;
          
          &lt;service android:name=&quot;.java.MyFirebaseMessagingService&quot; android:exported=&quot;false&quot;&gt;
              &lt;intent-filter&gt;
                  &lt;action android:name=&quot;com.google.firebase.MESSAGING_EVENT&quot; /&gt;
              &lt;/intent-filter&gt;    
          &lt;/service&gt;    
      &lt;/application&gt;
  &lt;/manifest&gt;
  </code></pre>
  <p>and my Application.kt file is</p>
  <pre><code>package com.samriddh.partner
  
  import io.flutter.app.FlutterApplication
  import io.flutter.plugin.common.PluginRegistry
  import io.flutter.plugin.common.PluginRegistry.PluginRegistrantCallback
  import io.flutter.plugins.GeneratedPluginRegistrant
  import io.flutter.plugins.firebasemessaging.FlutterFirebaseMessagingService
  
  class Application : FlutterApplication(), PluginRegistrantCallback {
  
      override fun onCreate() {
          super.onCreate()
          FlutterFirebaseMessagingService.setPluginRegistrant(this);
      }
  
      override fun registerWith(registry: PluginRegistry?) {
          io.flutter.plugins.firebasemessaging.FirebaseMessagingPlugin.registerWith(registry?.registrarFor(&quot;io.flutter.plugins.firebasemessaging.FirebaseMessagingPlugin&quot;));
      }
  }
  </code></pre>