android 中 unable to start service 错误解决方法
2012-12-27 14:51
453 查看
在调试一个android apk 时,老是遇到一个Unable to start service(has extras), Intent not found. 仔细检查了一下,发现没有将该 Service 注册到 Application 里面。 error code: [html]view plaincopyprint? <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> [html]view plaincopyprint? <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类的完全名(全路径) |
相关文章推荐
- android 中 unable to start service 错误解决方法
- android 中 unable to start service 错误解决方法
- android 中 unable to start service 错误解决方法
- WARN/ActivityManager(982): Unable to start service Intent { cmp=.../...}: not found 解决方法
- Android开发中java.lang.RuntimeException: Unable to start activity ComponentInfo{xxx}: java.lang.NullPointerException 错误的集中原因及解决办法
- 关于在eclipse下android开发的错误:“Unable to resolve target 'android-18'"的解决方法
- Eclipse运行Android程序报Error generating final archive: Unable to get debug signature key错误解决方法
- Unable to add window -- token null is not for an application错误的解决方法 android开发
- Android开发中java.lang.RuntimeException: Unable to start activity ComponentInfo{xxx}: java.lang.NullPointerException 错误的集中原因及解决办法
- Android Studio error: Unable to start the daemon process的解决方法
- Unable to start service Intent { cmp=.../...}: not found 解决方法
- Android开发中的Unable to resolve superclass of L错误解决方法
- Unable to add window -- token null is not for an application错误的解决方法 android开发
- 导入android项目出现:出现Unable to resolve target 'android-8'错误的解决方法
- android学习历程——“Unable to open log device '/dev/log/main': No such file or directory”错误解决方法
- Conversion to Dalvik format failed: Unable to execute dex 解决Android打包错误
- Mac中第一次使用Android Studio出现unable to access android sdk add-on list的解决方法
- android 莫名出现Conversion to Dalvik format failed: Unable to execute dex: null 解决方法
- Unable to get the project ile from the web server错误的解决方法
- 【Android笔记】Unable to execute dex: Multiple dex files define 解决方法