Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.IllegalArgumentException: Service not registered #503

Closed
1 of 2 tasks
inceptusp opened this issue Sep 2, 2020 · 25 comments
Closed
1 of 2 tasks

java.lang.IllegalArgumentException: Service not registered #503

inceptusp opened this issue Sep 2, 2020 · 25 comments
Labels
platform: android Issue is related to the Android platform. status: in progress Indicates that this issue is currently being worked on. type: bug Something isn't working

Comments

@inceptusp
Copy link

inceptusp commented Sep 2, 2020

🔙 Regression

After upgrading to 6.0.0+1 I started to receive an exception as a warning on console multiple times

Old (and correct) behavior

Not having an exception

Reproduction steps

Just ask the position and the error appears after a while

Configuration

Version: 6.0.0+1

Platform:

  • 📱 iOS
  • 🤖 Android

Console output

W/ConnectionTracker( 1662): Exception thrown while unbinding
W/ConnectionTracker( 1662): java.lang.IllegalArgumentException: Service not registered: com.google.android.gms.measurement.internal.zzjf@5516abb
W/ConnectionTracker( 1662):     at android.app.LoadedApk.forgetServiceDispatcher(LoadedApk.java:1870)
W/ConnectionTracker( 1662):     at android.app.ContextImpl.unbindService(ContextImpl.java:1847)
W/ConnectionTracker( 1662):     at android.content.ContextWrapper.unbindService(ContextWrapper.java:755)
W/ConnectionTracker( 1662):     at com.google.android.gms.common.stats.ConnectionTracker.zza(com.google.android.gms:play-services-basement@@17.3.0:55)
W/ConnectionTracker( 1662):     at com.google.android.gms.common.stats.ConnectionTracker.unbindService(com.google.android.gms:play-services-basement@@17.3.0:50)
W/ConnectionTracker( 1662):     at com.google.android.gms.measurement.internal.zzin.zzah(com.google.android.gms:play-services-measurement-impl@@17.4.1:246)
W/ConnectionTracker( 1662):     at com.google.android.gms.measurement.internal.zzin.zzam(com.google.android.gms:play-services-measurement-impl@@17.4.1:263)
W/ConnectionTracker( 1662):     at com.google.android.gms.measurement.internal.zzin.zzc(com.google.android.gms:play-services-measurement-impl@@17.4.1:330)
W/ConnectionTracker( 1662):     at com.google.android.gms.measurement.internal.zziq.zza(com.google.android.gms:play-services-measurement-impl@@17.4.1:2)
W/ConnectionTracker( 1662):     at com.google.android.gms.measurement.internal.zzah.run(com.google.android.gms:play-services-measurement-impl@@17.4.1:7)
W/ConnectionTracker( 1662):     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462)
W/ConnectionTracker( 1662):     at java.util.concurrent.FutureTask.run(FutureTask.java:266)
W/ConnectionTracker( 1662):     at com.google.android.gms.measurement.internal.zzfy.run(com.google.android.gms:play-services-measurement-impl@@17.4.1:21)
@mvanbeusekom
Copy link
Member

@inceptusp this seems like an issue with the Google Play Services. Do you have Google Play Services installed on your device?

Did you use the forceAndroidLocationManager property with the previous versions of the Geolocator plugin? If so you can now pass this as a parameter to the getCurrentPosition and getPositionStream methods. This will force Android to use the legacy LocationManager instead of the FusedLocationProviderClient (which requires Google Play Services).

@inceptusp
Copy link
Author

inceptusp commented Sep 2, 2020

@mvanbeusekom Yes, I have Google Play Services... It is a Samsung Galaxy J6, the same device I was using before the update... I never used the forceAndroidLocationManager property... By the way, before the update, I was even using that methods to perform Geocoding and Reverse Geocoding, which is now under a diferent plugin and requires Play Services too, and they seem to be working fine...

@GrahamDi
Copy link

GrahamDi commented Sep 2, 2020

@mvanbeusekom @inceptusp

FYI. I have also been seeing this error after I upgraded to 6.0.0+1. When I revert to 5.3.2+2 it goes away again. I have moved my geocoding calls to geocoding 1.0.3 and that is working fine. The issue is definitely with geolocator 6.0.0+1. I also don't use forceAndroidLocationManager and I use Play Services. Been trying to use the debugger to narrow the issue down to a particular call before I reported it but struggling. It only appears after I load my home page and appears to have a delay so could be a listener or an async await call.

@loooookiezxc
Copy link

I also saw this recently, correct me if I'm wrong but com.google.android.gms.measurement.internal came from Firebase Analytics API. Maybe the firebase plugin and geolocator are communicating in some ways. Also saw this issue on the Firebase Core plugin.

@mvanbeusekom
Copy link
Member

@GrahamDi @inceptusp it looks like it is related to this issue and I noticed that we indeed bring in the com.google.android.gms:play-services-base:17.3.0 as part of the geolocator build.gradle file.

This should be fixed by removing the line, but I need to test this out. I will do so today / tomorrow and then make a new release.

@mvanbeusekom mvanbeusekom added platform: android Issue is related to the Android platform. type: bug Something isn't working up for graps Issues marked with this label are relatively easy problems that are ideal for starting contributors. labels Sep 2, 2020
@mvanbeusekom mvanbeusekom added this to the geolocator 6.0.0+2 milestone Sep 2, 2020
@mvanbeusekom
Copy link
Member

Hi @inceptusp and @GrahamDi, I have just release version 6.0.0+2 of the geolocator plugin where I removed the com.google.android.gms:play-services-base:17.3.0 line from the geolocator's build.gradle file. Is it possible for one of you to test if this solved the problem? I would really appreciate that.

@mvanbeusekom mvanbeusekom added status: needs more info We need more information before we can continue work on this issue. status: in progress Indicates that this issue is currently being worked on. and removed up for graps Issues marked with this label are relatively easy problems that are ideal for starting contributors. status: needs more info We need more information before we can continue work on this issue. labels Sep 3, 2020
@GrahamDi
Copy link

GrahamDi commented Sep 3, 2020 via email

@inceptusp
Copy link
Author

@mvanbeusekom I have just tested and it is working flawlessly now... Thx

@mvanbeusekom
Copy link
Member

Glad to hear! Thanks for the feedback and posting the bug report!

Will close the issue, if the error pops up again let me know and I’ll reopen it again

@GrahamDi
Copy link

GrahamDi commented Sep 4, 2020

@mvanbeusekom Finally got around to testing it. Working fine for me also. Thanks a lot for fixing so quickly.

@KingAlawaka
Copy link

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

implementation 'com.google.android.gms:play-services-basement:17.5.0'
implementation 'com.google.firebase:firebase-analytics:18.0.0'

@amroomi
Copy link

amroomi commented Dec 10, 2020

Glad to hear! Thanks for the feedback and posting the bug report!

Will close the issue, if the error pops up again let me know and I’ll reopen it again

I still have the same issue.

pubspec.yaml file
cupertino_icons: ^1.0.1
firebase_core: ^0.5.3
firebase_auth: ^0.18.4+1
firebase_database: ^4.4.0

Project level build.gradle
dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
classpath 'com.google.gms:google-services:4.3.4'
}

App level build.gradle
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'

dependencies {
implementation platform('com.google.firebase:firebase-bom:26.1.1')
}

The error occurs after adding this line to App level build.gradle file
apply plugin: 'com.google.gms.google-services'

@mvanbeusekom
Copy link
Member

@amroomi not sure I can help here, your listing of the pubspec.yaml doesn't mention you are using the "geolocator" plugin.

Looks like this has to do something with the other "firebase" plugins, this issue is still open for those plugins: firebase/firebase-android-sdk#1662

@amroomi
Copy link

amroomi commented Dec 10, 2020

@mvanbeusekom I am not using geolocator plugin I am only using firebase core, auth and database plugins.

@mvanbeusekom
Copy link
Member

Yes but you are raising this issue in the geolocator repository. We maintain the geolocator and have no relation to the firebase plugins.

@sontn15
Copy link

sontn15 commented Dec 11, 2020

Same me

W/ConnectionTracker: Exception thrown while unbinding
java.lang.IllegalArgumentException: Service not registered: lu@c38f59c
at android.app.LoadedApk.forgetServiceDispatcher(LoadedApk.java:1671)
at android.app.ContextImpl.unbindService(ContextImpl.java:1781)
at android.content.ContextWrapper.unbindService(ContextWrapper.java:730)
at ci.f(:com.google.android.gms.dynamite_measurementdynamite@204516065@20.45.16 (100400-0):1)
at ci.d(:com.google.android.gms.dynamite_measurementdynamite@204516065@20.45.16 (100400-0):2)
at lv.E(:com.google.android.gms.dynamite_measurementdynamite@204516065@20.45.16 (100400-0):9)
at lf.a(:com.google.android.gms.dynamite_measurementdynamite@204516065@20.45.16 (100400-0):3)
at ef.run(:com.google.android.gms.dynamite_measurementdynamite@204516065@20.45.16 (100400-0):3)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:459)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at iy.run(:com.google.android.gms.dynamite_measurementdynamite@204516065@20.45.16 (100400-0):5)

@sebastien-michel
Copy link

Same me

W/ConnectionTracker: Exception thrown while unbinding
java.lang.IllegalArgumentException: Service not registered: lu@c38f59c
at android.app.LoadedApk.forgetServiceDispatcher(LoadedApk.java:1671)
at android.app.ContextImpl.unbindService(ContextImpl.java:1781)
at android.content.ContextWrapper.unbindService(ContextWrapper.java:730)
at ci.f(:com.google.android.gms.dynamite_measurementdynamite@204516065@20.45.16 (100400-0):1)
at ci.d(:com.google.android.gms.dynamite_measurementdynamite@204516065@20.45.16 (100400-0):2)
at lv.E(:com.google.android.gms.dynamite_measurementdynamite@204516065@20.45.16 (100400-0):9)
at lf.a(:com.google.android.gms.dynamite_measurementdynamite@204516065@20.45.16 (100400-0):3)
at ef.run(:com.google.android.gms.dynamite_measurementdynamite@204516065@20.45.16 (100400-0):3)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:459)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at iy.run(:com.google.android.gms.dynamite_measurementdynamite@204516065@20.45.16 (100400-0):5)

I have now the same error, didn't touch my code and it was working 2 days ago...

@mvanbeusekom
Copy link
Member

@sontn15, @sebastien-michel, just to make sure are you both using the geolocator plugin?

Do you depend on any other packages (i.e. firebase)?

Could you provide some additional information? Mostly the contents of the pubspec.yaml, build.gradle and the output of the flutter doctor -v command.

@inceptusp
Copy link
Author

inceptusp commented Dec 11, 2020

@amroomi @sontn15 @sebastien-michel this error is a bug on firebase_core tracked by this issue: firebase/flutterfire#4090

It was a bug on Geolocator but @mvanbeusekom has fixed it... You should complain with flutterfire team... I am too receiving this same messages using firebase_admob since it requires firebase_core which is the cause of the issue...

@Nasar-uddin
Copy link

Nasar-uddin commented Dec 12, 2020

The same problem while login in firebase with Facebook

W/ConnectionTracker(26498): Exception thrown while unbinding
W/ConnectionTracker(26498): java.lang.IllegalArgumentException: Service not registered: ls@76dcf29
W/ConnectionTracker(26498): 	at android.app.LoadedApk.forgetServiceDispatcher(LoadedApk.java:1759)
W/ConnectionTracker(26498): 	at android.app.ContextImpl.unbindService(ContextImpl.java:1786)
W/ConnectionTracker(26498): 	at android.content.ContextWrapper.unbindService(ContextWrapper.java:751)

@dulkith
Copy link

dulkith commented Dec 14, 2020

Same problem

W/ConnectionTracker( 4736): Exception thrown while unbinding
W/ConnectionTracker( 4736): java.lang.IllegalArgumentException: Service not registered: ls@c33423gd
W/ConnectionTracker( 4736): 	at android.app.LoadedApk.forgetServiceDispatcher(LoadedApk.java:1757)
W/ConnectionTracker( 4736): 	at android.app.ContextImpl.unbindService(ContextImpl.java:1874)
W/ConnectionTracker( 4736): 	at android.content.ContextWrapper.unbindService(ContextWrapper.java:792)
W/ConnectionTracker( 4736): 	at ci.f(:com.google.android.gms.dynamite_measurementdynamite@204713100@20.47.13 (150700-0):1)
W/ConnectionTracker( 4736): 	at ci.d(:com.google.android.gms.dynamite_measurementdynamite@204713100@20.47.13 (150700-0):2)
W/ConnectionTracker( 4736): 	at lt.E(:com.google.android.gms.dynamite_measurementdynamite@204713100@20.47.13 (150700-0):9)
W/ConnectionTracker( 4736): 	at ld.a(:com.google.android.gms.dynamite_measurementdynamite@204713100@20.47.13 (150700-0):3)
W/ConnectionTracker( 4736): 	at ef.run(:com.google.android.gms.dynamite_measurementdynamite@204713100@20.47.13 (150700-0):3)
W/ConnectionTracker( 4736): 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462)
W/ConnectionTracker( 4736): 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
W/ConnectionTracker( 4736): 	at iy.run(:com.google.android.gms.dynamite_measurementdynamite@204713100@20.47.13 (150700-0):5)

@inceptusp
Copy link
Author

@vsalamov
Copy link

Same problem with atttempt show admob test ad

@mvanbeusekom
Copy link
Member

@Nasar-uddin, @dulkith, @vsalamov, really curious why you are posting these problems here? How does this related to the geolocator plugin?

Please provide information on why you think this problem has to do with the geolocator plugin (since we solved this issue months ago). If you are having this issue and do not make use of the geolocotor plugin, the answer is: you are in the wrong place, please post this issue in the correct location (if you are experiencing this problem in combination with Firebase, read through issue firebase/flutterfire#4090, they document workarounds (for example here).

@inceptusp
Copy link
Author

@mvanbeusekom I think you should lock this thread for now... They are posting these things here because when you search the error on Google it leave them here...

@Baseflow Baseflow locked and limited conversation to collaborators Dec 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
platform: android Issue is related to the Android platform. status: in progress Indicates that this issue is currently being worked on. type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests