android 中 unable to start service 错误解决方法
来源:互联网 发布:cad网络面板图标 编辑:程序博客网 时间:2024/06/05 06:47
昨日在调试一个android apk 时,老是遇到一个Unable to start service(has extras), Intent not found.
仔细检查了一下,发现没有将该 Service 注册到 Application 里面。
error code:
- <application
- android:icon="@drawable/ic_launcher"
- android:label="@string/app_name" >
- <activity
- android:name=".MP3ListActivity"
- android:label="@string/app_name" >
- <intent-filter>
- <action android:name="android.intent.action.MAIN" />
- <category android:name="android.intent.category.LAUNCHER" />
- </intent-filter>
- </activity>
- </application>
- <service android:name="***.MP3PlayerService.DownloadService">
- lt;/service>
correct code:
- <application
- android:icon="@drawable/ic_launcher"
- android:label="@string/app_name" >
- <activity
- android:name=".MP3ListActivity"
- android:label="@string/app_name" >
- <intent-filter>
- <action android:name="android.intent.action.MAIN" />
- <category android:name="android.intent.category.LAUNCHER" />
- </intent-filter>
- </activity>
- <service android:name="***.MP3PlayerService.DownloadService">
- </service>
- </application>
注意:由于 Activity 和 Service 不在同一个包内,故此处service 的 android:name 应该是全包名
解决方法:
1.检查AndroidManifest.xml配置文件中是否配置了service
2.检查service 是否在application标签内
3.如果你的service和启动的activity不在同一个包内,需要把service标签中的android:name配置成service类的完全名(全路径)
附上作者原文地址:http://blog.csdn.net/fulinwsuafcie/article/details/7397441
0 0
- android 中 unable to start service 错误解决方法
- android 中 unable to start service 错误解决方法
- android 中 unable to start service 错误解决方法
- android 中 unable to start service 错误解决方法
- Android 报 Unable to start service Intent { } U=0: not found错误
- Unable to start service Intent not found 错误
- Unable to start service Intent not found 错误
- Unable to start service Intent
- unable to start service intent
- ArcGIS Unable to Start service
- android:unable to start service intent not found
- 奇葩的Android Bug: Unable to start service Intent
- Android: unable to start service intent: u0 not found
- IntentService报Unable to instantiate service 错误的解决方法
- Android----Error:Unable to start the daemon process:错误
- android studio 错误Error:Unable to start the daemon process.
- Unable to start service Intent问题解决
- Android中的"Unable to start activity ComponentInfo"或者"Unable to instantiate activity ComponentInfo"的错误
- mac安装jello,安装不过去,报gyp WARN EACCES user "root" does not have permission to access the dev dir "/root/
- 连载《一个程序猿的生命周期》-21.而立之年,第一次跳槽,寻求转型
- poj 3984 迷宫问题 【BFS + 优先队列 + stack路径记录】
- 购物车结算功能
- 统计学生平均成绩
- android 中 unable to start service 错误解决方法
- Mipmapping and NPOT textures inside a pixel shader
- python 使用post登录网易
- 使用CAShapeLayer与UIBezierPath画出想要的图形
- 如何理解Linux下的动态库概念,和静态库概念,通俗易懂的解释如下:
- Netty权威指南之编码和解码技术
- mysql建立emp表
- 是我没本事
- Windows的toFileTimeutc时间转为GMT时间