Solvedflutterfire πŸ› [firebase_core] java.lang.IllegalArgumentException: Service not registered: com.google.android.gms.measurement.internal.zzji@dbed45a

Bug report

Describe the bug
app crashing when launching on below error , it was working before when using firebase_core: 0.5.0+1

there is open issue on google:
firebase/firebase-android-sdk#1662

  firebase_core: ^0.5.2
  firebase_crashlytics: ^0.2.3
  firebase_analytics: ^6.2.0
  firebase_messaging: ^7.0.3
  firebase_ml_vision: ^0.9.9
  firebase_admob: ^0.10.2
  firebase_remote_config: ^0.4.2

Steps to reproduce

Steps to reproduce the behavior:

1. take example from firebase_ml
2. add below dependency
   firebase_core: ^0.5.2
  firebase_crashlytics: ^0.2.3
  firebase_analytics: ^6.2.0
  firebase_messaging: ^7.0.3
  firebase_ml_vision: ^0.9.9
  firebase_admob: ^0.10.2
  firebase_remote_config: ^0.4.2
4. under build gradle add

dependencies {
..........
    **api 'com.google.firebase:firebase-ml-vision-barcode-model:16.1.2'
    api 'com.google.firebase:firebase-ml-vision:24.1.0'**
.................
    **implementation 'com.google.android.gms:play-services-vision-common:19.1.2'
    implementation 'com.google.android.gms:play-services-vision:20.1.2'
    implementation 'com.google.android.gms:play-services-vision-image-label:18.1.0'**
}

run app and you will see error in console

event sent after app closed: {id: 0, progressId: null, message: Running "flutter pub get" in barcode_app...}
event sent after app closed: {id: 0, progressId: null, finished: true}
Launching lib\main.dart on Android SDK built for x86 in debug mode...
Running Gradle task 'assembleDebug'...
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: C:\Tools\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_analytics-6.2.0\android\src\main\java\io\flutter\plugins\firebaseanalytics\FirebaseAnalyticsPlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: C:\Tools\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_remote_config-0.4.2\android\src\main\java\io\flutter\plugins\firebase\firebaseremoteconfig\MethodCallHandlerImpl.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: C:\Tools\flutter\.pub-cache\hosted\pub.dartlang.org\flutter_flexible_toast-0.1.4\android\src\main\kotlin\sanketvekariya\flutter_flexible_toast\GifImageView.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: C:\Tools\flutter\.pub-cache\hosted\pub.dartlang.org\flutter_custom_tabs-0.6.0\android\src\main\java\com\github\droibit\flutter\plugins\customtabs\internal\Launcher.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: C:\Tools\flutter\.pub-cache\hosted\pub.dartlang.org\just_audio-0.5.6\android\src\main\java\com\ryanheise\just_audio\AudioPlayer.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: C:\Tools\flutter\.pub-cache\git\multi_image_picker-b853ec2d6f1d7f6ee792020a9883287c20ed03a1\android\src\main\java\com\vitanov\multiimagepicker\FileDirectory.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
√ Built build\app\outputs\flutter-apk\app-debug.apk.
Installing build\app\outputs\flutter-apk\app.apk...
Waiting for Android SDK built for x86 to report its views...
Debug service listening on ws://127.0.0.1:57939/-2edWHjMHus=/ws
Syncing files to device Android SDK built for x86...
D/EGL_emulation(17466): eglMakeCurrent: 0xd9c1b080: ver 2 0 (tinfo 0xd9c0fcf0)
I/Choreographer(17466): Skipped 133 frames!  The application may be doing too much work on its main thread.
D/TransportRuntime.CctTransportBackend(17466): Making request to: https://crashlyticsreports-pa.googleapis.com/v1/firelog/legacy/batchlog
I/.ltd.barcodeap(17466): NativeAlloc concurrent copying GC freed 18683(917KB) AllocSpace objects, 5(224KB) LOS objects, 49% free, 2635KB/5271KB, paused 407us total 103.618ms
D/EGL_emulation(17466): eglMakeCurrent: 0xecf7eda0: ver 2 0 (tinfo 0xd67396b0)
I/TransportRuntime.CctTransportBackend(17466): Status Code: 200
I/TransportRuntime.CctTransportBackend(17466): Content-Type: application/json; charset=UTF-8
I/TransportRuntime.CctTransportBackend(17466): Content-Encoding: gzip
W/.ltd.barcodeap(17466): Accessing hidden method Lsun/misc/Unsafe;->compareAndSwapObject(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Z (greylist, linking, allowed)
W/.ltd.barcodeap(17466): Accessing hidden method Lsun/misc/Unsafe;->putObject(Ljava/lang/Object;JLjava/lang/Object;)V (greylist, linking, allowed)
W/.ltd.barcodeap(17466): Accessing hidden method Landroid/media/AudioTrack;->getLatency()I (greylist, reflection, allowed)
I/ExoPlayerImpl(17466): Init a33330d [ExoPlayerLib/2.11.7] [generic_x86, Android SDK built for x86, Google, 29]
I/Choreographer(17466): Skipped 47 frames!  The application may be doing too much work on its main thread.
I/VideoCapabilities(17466): Unsupported profile 4 for video/mp4v-es
I/OMXClient(17466): IOmx service obtained
I/ACodec  (17466): codec does not support config priority (err -2147483648)
W/ConnectionTracker(17466): Exception thrown while unbinding
W/ConnectionTracker(17466): java.lang.IllegalArgumentException: Service not registered: com.google.android.gms.measurement.internal.zzji@c66690e
W/ConnectionTracker(17466): 	at android.app.LoadedApk.forgetServiceDispatcher(LoadedApk.java:1751)
W/ConnectionTracker(17466): 	at android.app.ContextImpl.unbindService(ContextImpl.java:1776)
W/ConnectionTracker(17466): 	at android.content.ContextWrapper.unbindService(ContextWrapper.java:741)
W/ConnectionTracker(17466): 	at com.google.android.gms.common.stats.ConnectionTracker.zza(com.google.android.gms:play-services-basement@@17.3.0:55)
W/ConnectionTracker(17466): 	at com.google.android.gms.common.stats.ConnectionTracker.unbindService(com.google.android.gms:play-services-basement@@17.3.0:50)
W/ConnectionTracker(17466): 	at com.google.android.gms.measurement.internal.zzio.zzag(com.google.android.gms:play-services-measurement-impl@@17.6.0:245)
W/ConnectionTracker(17466): 	at com.google.android.gms.measurement.internal.zzio.zzal(com.google.android.gms:play-services-measurement-impl@@17.6.0:262)
W/ConnectionTracker(17466): 	at com.google.android.gms.measurement.internal.zzio.zzc(com.google.android.gms:play-services-measurement-impl@@17.6.0:336)
W/ConnectionTracker(17466): 	at com.google.android.gms.measurement.internal.zzir.zza(com.google.android.gms:play-services-measurement-impl@@17.6.0:2)
W/ConnectionTracker(17466): 	at com.google.android.gms.measurement.internal.zzai.run(com.google.android.gms:play-services-measurement-impl@@17.6.0:7)
W/ConnectionTracker(17466): 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462)
W/ConnectionTracker(17466): 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
W/ConnectionTracker(17466): 	at com.google.android.gms.measurement.internal.zzfs.run(com.google.android.gms:play-services-measurement-impl@@17.6.0:21)
Application finished.
32 Answers

βœ”οΈAccepted Answer

I get the same error as @kw2019ltd :

W/ConnectionTracker(21022): Exception thrown while unbinding
W/ConnectionTracker(21022): java.lang.IllegalArgumentException: Service not registered: lq@777f952
W/ConnectionTracker(21022): 	at android.app.LoadedApk.forgetServiceDispatcher(LoadedApk.java)
W/ConnectionTracker(21022): 	at android.app.ContextImpl.unbindService(ContextImpl.java)
W/ConnectionTracker(21022): 	at android.content.ContextWrapper.unbindService(ContextWrapper.java)
W/ConnectionTracker(21022): 	at ci.f(:com.google.android.gms.dynamite_measurementdynamite@204215051@20.42.15 (040408-0):1)
W/ConnectionTracker(21022): 	at ci.d(:com.google.android.gms.dynamite_measurementdynamite@204215051@20.42.15 (040408-0):2)
W/ConnectionTracker(21022): 	at lr.D(:com.google.android.gms.dynamite_measurementdynamite@204215051@20.42.15 (040408-0):10)
W/ConnectionTracker(21022): 	at ld.a(:com.google.android.gms.dynamite_measurementdynamite@204215051@20.42.15 (040408-0):2)
W/ConnectionTracker(21022): 	at ef.run(:com.google.android.gms.dynamite_measurementdynamite@204215051@20.42.15 (040408-0):3)
W/ConnectionTracker(21022): 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:423)
W/ConnectionTracker(21022): 	at java.util.concurrent.FutureTask.run(FutureTask.java:237)
W/ConnectionTracker(21022): 	at iy.run(:com.google.android.gms.dynamite_measurementdynamite@204215051@20.42.15 (040408-0):6)

I get it in a new created flutter project with the only dependency firebase_core. Even with downgrading to 0.5.0 nothing changes.
Any updates to fix this?

Other Answers:

I'm also gettting this

W/ConnectionTracker(15730): Exception thrown while unbinding
W/ConnectionTracker(15730): java.lang.IllegalArgumentException: Service not registered: com.google.android.gms.measurement.internal.zzjl@4d1d01d
W/ConnectionTracker(15730): 	at android.app.LoadedApk.forgetServiceDispatcher(LoadedApk.java:1759)
W/ConnectionTracker(15730): 	at android.app.ContextImpl.unbindService(ContextImpl.java:1786)
W/ConnectionTracker(15730): 	at android.content.ContextWrapper.unbindService(ContextWrapper.java:751)
W/ConnectionTracker(15730): 	at com.google.android.gms.common.stats.ConnectionTracker.zza(com.google.android.gms:play-services-basement@@17.3.0:55)
W/ConnectionTracker(15730): 	at com.google.android.gms.common.stats.ConnectionTracker.unbindService(com.google.android.gms:play-services-basement@@17.3.0:50)
W/ConnectionTracker(15730): 	at com.google.android.gms.measurement.internal.zzir.zzag(com.google.android.gms:play-services-measurement-impl@@18.0.0:245)
W/ConnectionTracker(15730): 	at com.google.android.gms.measurement.internal.zzir.zzal(com.google.android.gms:play-services-measurement-impl@@18.0.0:262)
W/ConnectionTracker(15730): 	at com.google.android.gms.measurement.internal.zzir.zzc(com.google.android.gms:play-services-measurement-impl@@18.0.0:336)
W/ConnectionTracker(15730): 	at com.google.android.gms.measurement.internal.zziq.zza(com.google.android.gms:play-services-measurement-impl@@18.0.0:2)
W/ConnectionTracker(15730): 	at com.google.android.gms.measurement.internal.zzal.run(com.google.android.gms:play-services-measurement-impl@@18.0.0:7)
W/ConnectionTracker(15730): 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462)
W/ConnectionTracker(15730): 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
W/ConnectionTracker(15730): 	at com.google.android.gms.measurement.internal.zzfv.run(com.google.android.gms:play-services-measurement-impl@@18.0.0:21)

It seems to have started after updating Crashlytics SDK and adding FirebaseCore 0.5.2

App hasn't crashed yet but slightly concerned as I don't know what's causing this and needed to update Crashlytics

THIS SEEMS TO HAVE FIXED IT FOR ME

adding these two dependencies to app level build.gradle (../android/app/build.gradle)

dependencies {
    // other imports
    implementation 'com.google.firebase:firebase-analytics:18.0.0'
    implementation 'com.google.android.gms:play-services-basement:17.5.0'
}

This is a known issue issue with the Firebase Android SDK and therefore there's nothing we can do to fix it on FlutterFire until its fixed upstream; firebase/firebase-android-sdk#1662

Given that this is a non-fatal error and isn't causing a crash I don't think there's anything to worry about for the time being.

Same issue for me. Started for me just a few days ago

W/ConnectionTracker(29039): Exception thrown while unbinding
W/ConnectionTracker(29039): java.lang.IllegalArgumentException: Service not registered: lp@1f23aae
W/ConnectionTracker(29039): 	at android.app.LoadedApk.forgetServiceDispatcher(LoadedApk.java:1772)
W/ConnectionTracker(29039): 	at android.app.ContextImpl.unbindService(ContextImpl.java:1895)
W/ConnectionTracker(29039): 	at android.content.ContextWrapper.unbindService(ContextWrapper.java:792)
W/ConnectionTracker(29039): 	at ci.f(:com.google.android.gms.dynamite_measurementdynamite@204217097@20.42.17 (150400-0):1)
W/ConnectionTracker(29039): 	at ci.d(:com.google.android.gms.dynamite_measurementdynamite@204217097@20.42.17 (150400-0):2)
W/ConnectionTracker(29039): 	at lq.D(:com.google.android.gms.dynamite_measurementdynamite@204217097@20.42.17 (150400-0):10)
W/ConnectionTracker(29039): 	at lc.a(:com.google.android.gms.dynamite_measurementdynamite@204217097@20.42.17 (150400-0):2)
W/ConnectionTracker(29039): 	at ee.run(:com.google.android.gms.dynamite_measurementdynamite@204217097@20.42.17 (150400-0):3)
W/ConnectionTracker(29039): 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462)
W/ConnectionTracker(29039): 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
W/ConnectionTracker(29039): 	at ix.run(:com.google.android.gms.dynamite_measurementdynamite@204217097@20.42.17 (150400-0):6)

More Issues: