How to fix “Exception thrown while unbinding, java.lang.IllegalArgumentException: Service not registered: lp@9f7d4ca” exception in Flutter? [duplicate]

允我心安 提交于 2020-12-19 06:58:47


My debug console show me this:

W/ConnectionTracker(17934): Exception thrown while unbinding
W/ConnectionTracker(17934): java.lang.IllegalArgumentException: Service not registered: lp@9f7d4ca
W/ConnectionTracker(17934):     at
W/ConnectionTracker(17934):     at
W/ConnectionTracker(17934):     at android.content.ContextWrapper.unbindService(
W/ConnectionTracker(17934):     at ci.f( (100408-0):1)
W/ConnectionTracker(17934):     at ci.d( (100408-0):2)
W/ConnectionTracker(17934):     at lq.D( (100408-0):10)
W/ConnectionTracker(17934):     at lc.a( (100408-0):2)

I dont know how do i do it.


Add the following to your android\app\build.gradle

implementation ''
implementation ''


EDIT 16th Dec: The fix for this warning will be rolled out in February. Not sure how/why this thread was marked as closed and fixed because there were multiple cases of workarounds that worked more or less.

The real fix will be to try some of the suggestion and if they fail, just wait.

EDIT 13th Dec: From this Git discussion we have a confirmation that this error doesn't cause any other issues, nor crashes.

The old machine that wasn't throwing errors started doing so after an update.

We just have to wait for the update that will make these warnings go away.

EDIT 8th Dec: Nor Java nor adding the SHAs to my Firebase console helped with anything!

EDIT 4th Dec: Looks like on the machine with issues, I didn't have Java installed. All looks well after multiple builds and wipes. I'll keep an eye out!

Visit Oracle's site to download it! Thanks to Talha's comment about SHA (keytool requires Java)!

EDIT 3rd Dec: I did another Firebase setup and as Timo Bähr pointed out, the docs for Firebase setup were updated. As you can see, firebase-bom was added, but also the option to pick Java or Kotlin.

Double checked my project and:

  1. changed all dependencies to Kotlin (-ktx ending)
  2. wiped all the devices data
  3. removed old unused emulators
  4. cold booted the device (both from Android Studio Virtual device manager)

Now the errors are gone (for now?)!

// Import the Firebase BoM
implementation platform('')

// When using the BoM, you don't specify versions in Firebase library dependencies

// Declare the dependency for the Firebase SDK for Google Analytics
implementation ''

// Declare the dependencies for any other desired Firebase products
// For example, declare the dependencies for Firebase Authentication and Cloud Firestore
implementation ''
implementation ''

EDIT 26th Nov: Exceptions are back even with previous fix from King.

EDIT 23rd Nov: The errors started appearing again after 1-2 days. Please check King Alawaka's answer which may hold the solution which is the same as this Github reply. Positive feedback is coming from it. :)

Initial response: After updating the Firebase dependencies I got rid of these errors. Here are the versions I'm currently using:

firebase_core: ^0.5.2
firebase_database: ^4.3.0
firebase_analytics: ^6.2.0
firebase_messaging: ^7.0.3
firebase_crashlytics: ^0.2.3

This may not help because I saw this git issue where the reported versions are similar to the ones I use.

Other options that failed:

  • implementation '' to android\app\build.gradle
  • downgrade certain packages only to versions ~1 month old
  • disabling analytics and crashlytics (removed the packages too)
  • switching emulated device
  • whipping all data on those device/s


Latest Firebase documentation saying:

// Add this line
apply plugin: ''

dependencies {
    // Import the Firebase BoM
    implementation platform('')

    // Add the dependency for the Firebase SDK for Google Analytics
    // When using the BoM, don't specify versions in Firebase dependencies
    implementation ''

    // Add the dependencies for any other desired Firebase products

After adding firebase-analytics-ktx the error disappeared.