从Android中的Activity启动服务时出现“无法启动服务Intent”错误

时间:2014-03-05 03:59:24

标签: java android eclipse android-intent

以下是错误的确切描述 -

Unable to start service Intent {cmp=com.example.firstapp/com.radiusnetworks.ibeacon.IBeaconIntentProcessor (has extras) } U=0: not found

这是我的android manifest.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.firstapp"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
    android:minSdkVersion="18"
    android:targetSdkVersion="18" />
<uses-permission android:name="android.permission.BLUETOOTH"/>
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>

<application

    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name="com.example.firstapp.MainActivity"
        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:enabled="true"
    android:exported="true"
    android:isolatedProcess="false"
    android:label="iBeacon"
    android:name="com.radiusnetworks.ibeacon.service.IBeaconService">
<meta-data android:name="background" android:value="true" />
    <intent-filter 
       android:priority="1" >
        <action android:name="com.example.firstapp.DID_RANGING" />
        <action android:name="com.example.firstapp.DID_MONITORING" />
    </intent-filter>
</service>

我是Android和Java的新手,但我真的必须让它工作。 在此先感谢.. !!

1 个答案:

答案 0 :(得分:0)

您没有注册名为IBeaconIntentProcessor的服务以及哪个包是......

com.radiusnetworks.ibeacon

这就是为什么它找不到服务。

您已注册服务IBeaconService以及哪个包

com.radiusnetworks.ibeacon.service

Service中注册Manifest.xml,如下所示......

<service android:name="com.radiusnetworks.ibeacon.IBeaconIntentProcessor">