如何解决“解除绑定时抛出的异常,java.lang.IllegalArgumentException:服务未注册:lp @ 9f7d4ca"Flutter中的异常? [英] How to fix "Exception thrown while unbinding, java.lang.IllegalArgumentException: Service not registered: lp@9f7d4ca" exception in Flutter?

查看:210
本文介绍了如何解决“解除绑定时抛出的异常,java.lang.IllegalArgumentException:服务未注册:lp @ 9f7d4ca"Flutter中的异常?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的调试控制台向我显示以下内容:

  W/ConnectionTracker(17934):解除绑定时引发异常W/ConnectionTracker(17934):java.lang.IllegalArgumentException:服务未注册:lp @ 9f7d4caW/ConnectionTracker(17934):位于android.app.LoadedApk.forgetServiceDispatcher(LoadedApk.java:1557)W/ConnectionTracker(17934):位于android.app.ContextImpl.unbindService(ContextImpl.java:1692)W/ConnectionTracker(17934):位于android.content.ContextWrapper.unbindService(ContextWrapper.java:717)W/ConnectionTracker(17934):位于ci.f(:com.google.android.gms.dynamite_measurementdynamite @ 204215067 @ 20.42.15(100408-​​0):1)W/ConnectionTracker(17934):位于ci.d(:com.google.android.gms.dynamite_measurementdynamite @ 204215067 @ 20.42.15(100408-​​0):2)W/ConnectionTracker(17934):位于lq.D(:com.google.android.gms.dynamite_measurementdynamite @ 204215067 @ 20.42.15(100408-​​0):10)W/ConnectionTracker(17934):位于lc.a(:com.google.android.gms.dynamite_measurementdynamite @ 204215067 @ 20.42.15(100408-​​0):2) 

我不知道该怎么做.

解决方案

我保留了堆栈中的第一条消息,以确保没有其他任何我要忽略的消息.这就是两个警告最终看起来的样子,而不是26行混乱的代码.

编辑12月16日:此警告的解决方案将于2月推出.不确定如何/为什么将此线程标记为已关闭并已修复,因为存在多种变通办法或多或少起作用的情况.

真正的解决方法是尝试一些建议,如果建议失败,请稍候.

编辑12月13日:来自此 Oracle的站点进行下载!感谢Talha对SHA的评论(keytool需要Java)!

编辑12月3日:我进行了另一个Firebase设置,正如TimoBähr指出的那样,此Github回复.积极的反馈来自于此.:)

初始响应:更新Firebase依赖关系后,我摆脱了这些错误.这是我当前正在使用的版本:

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

这可能无济于事,因为我看到了此git问题报告的版本与我使用的版本相似.

其他失败的选项:

  • 实现'com.google.android.gms:play-services-basement:17.5.0' android \ app \ build.gradle
  • 仅将某些软件包降级到大约1个月的版本
  • 禁用分析和crashlytics(也删除了软件包)
  • 切换模拟设备
  • 在这些设备上鞭打所有数据

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 android.app.LoadedApk.forgetServiceDispatcher(LoadedApk.java:1557)
W/ConnectionTracker(17934):     at android.app.ContextImpl.unbindService(ContextImpl.java:1692)
W/ConnectionTracker(17934):     at android.content.ContextWrapper.unbindService(ContextWrapper.java:717)
W/ConnectionTracker(17934):     at ci.f(:com.google.android.gms.dynamite_measurementdynamite@204215067@20.42.15 (100408-0):1)
W/ConnectionTracker(17934):     at ci.d(:com.google.android.gms.dynamite_measurementdynamite@204215067@20.42.15 (100408-0):2)
W/ConnectionTracker(17934):     at lq.D(:com.google.android.gms.dynamite_measurementdynamite@204215067@20.42.15 (100408-0):10)
W/ConnectionTracker(17934):     at lc.a(:com.google.android.gms.dynamite_measurementdynamite@204215067@20.42.15 (100408-0):2)

I dont know how do i do it.

解决方案

The fix for this warning will be rolled out in February!

EDIT 11th Feb: From quick tests, I see that this warning is gone in v. 8.0.0 of Firebase messaging, but the package is still in dev; link to it.

EDIT 13th Jan: Android Studios has a neat option in the output to fold lines. If you want to get rid of the long messages that easily interfere while developing right click on the line and fold it. But tweak it before because certain values change.

From this stack:

W/ConnectionTracker(13852): java.lang.IllegalArgumentException: Service not registered: ls@ed97760
W/ConnectionTracker(13852):     at android.app.LoadedApk.forgetServiceDispatcher(LoadedApk.java:1562)
W/ConnectionTracker(13852):     at android.app.ContextImpl.unbindService(ContextImpl.java:1692)
W/ConnectionTracker(13852):     at android.content.ContextWrapper.unbindService(ContextWrapper.java:717)
W/ConnectionTracker(13852):     at ci.f(:com.google.android.gms.dynamite_measurementdynamite@204714068@20.47.14 (100700-0):1)
...

Change the folded ones to:

java.lang.IllegalArgumentException: Service not registered: 
at android.app.LoadedApk.forgetServiceDispatcher(LoadedApk.java:
at android.app.ContextImpl.unbindService(ContextImpl.java:
at android.content.ContextWrapper.unbindService(ContextWrapper.java:
f(:com.google.android.gms.dynamite_measurementdynamite@
...

And so on. I advice you to keep the original folded message and just add a new one to have a history of what you're changing.

I kept the first message from the stack to make sure it's nothing else I'm ignoring. This is how two warnings ended up looking instead of 26 lines of cluttering code.

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('com.google.firebase:firebase-bom:26.1.0')

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

// Declare the dependency for the Firebase SDK for Google Analytics
implementation 'com.google.firebase:firebase-analytics-ktx'

// Declare the dependencies for any other desired Firebase products
// For example, declare the dependencies for Firebase Authentication and Cloud Firestore
implementation 'com.google.firebase:firebase-auth-ktx'
implementation 'com.google.firebase:firebase-firestore-ktx'

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 'com.google.android.gms:play-services-basement:17.5.0' 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

这篇关于如何解决“解除绑定时抛出的异常,java.lang.IllegalArgumentException:服务未注册:lp @ 9f7d4ca"Flutter中的异常?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆