Android: unable to start service intent: u0 not found

来源:互联网 发布:知乎怎么回答问题 编辑:程序博客网 时间:2024/06/04 23:29

http://stackoverflow.com/questions/3439356/unable-to-start-service-intent

I hope I can help someone with this info as well: I moved my service class into another package and I fixed the references. The project was perfectly fine, BUT the service class could not be found by the activity.By watching the log in logcat I noticed the warning about the issue: the activity could not find the service class, but the funny thing was that the package was incorrect, it contained a "/" char. The compiler was looking forcom.something./service.MyServiceinstead ofcom.something.service.MyServiceI moved the service class out from the package and back in and everything worked just fine.

从来未遇到过如此问题, 因为启动service 这种简单的 代码,还是写了很多的

然后这个问题折腾了我快 1天 , 网络上查了半天 无非就是,
检查配置文件,
高版本action 启动service时,add packagename

按照 stackoverflow说的 clean project也不行。
最后,从起手机,才不报错了,找到了新添加的sevice

0 0
原创粉丝点击