Application fails to bind service
<p>I am trying to bind a service which is included in a Library project with the following lines:</p>

<pre class="lang-java prettyprint-override"><code>Intent i = new Intent();
i.setClassName("de.ring0", "de.ring0.ToolkitService");
bindService(i, this, Context.BIND_AUTO_CREATE);
</code></pre>

<p>The binding process fails with the debug output below. According to the Android developer documentation the options in the two manifest files should be correct.</p>

<h2>AndroidManifest.xml Library Project</h2>

<pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="de.ring0"&gt;
    &lt;uses-sdk android:minSdkVersion="8" /&gt;
    &lt;application android:debuggable="true"&gt;
        &lt;service android:name="de.ring0.ToolkitService" android:exported="true" android:enabled="true"/&gt;
    &lt;/application&gt;
&lt;/manifest&gt;
</code></pre>

<h2>AndroidManifest.xml Main Project</h2>

<pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="de.ring0.example.tactilecompass"
      android:versionCode="1"
      android:versionName="1.0"&gt;
    &lt;uses-sdk android:minSdkVersion="8" /&gt;

     &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"&gt;&lt;/uses-permission&gt;
    &lt;uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /&gt;
    &lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"&gt;&lt;/uses-permission&gt;
    &lt;uses-permission android:name="android.permission.VIBRATE"&gt;&lt;/uses-permission&gt;

    &lt;application android:icon="@drawable/icon" android:label="@string/app_name" android:debuggable="true"&gt;
        &lt;activity android:name=".TactileCompassActivity"
                  android:label="@string/app_name"&gt;
            &lt;intent-filter&gt;
                &lt;action android:name="android.intent.action.MAIN" /&gt;
                &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
            &lt;/intent-filter&gt;
        &lt;/activity&gt;
        &lt;service android:name="de.ring0.ToolkitService" /&gt;
    &lt;/application&gt;
&lt;/manifest&gt;
</code></pre>

<h2>Debug Log from emulator</h2>

<pre><code>W/ActivityManager(   59): Permission denied: checkComponentPermission() reqUid=10036
W/ActivityManager(   59): Permission Denial: Accessing service ComponentInfo{de.ring0/de.ring0.ToolkitService} from pid=2994, uid=10037 requires null
W/dalvikvm( 2994): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
E/AndroidRuntime( 2994): FATAL EXCEPTION: main
E/AndroidRuntime( 2994): java.lang.RuntimeException: Unable to start activity ComponentInfo{de.ring0.example.tactilecompass/de.ring0.example.tactilecompass.TactileCompassActivity}: java.lang.SecurityException: Not allowed to bind to service Intent { cmp=de.ring0/.ToolkitService }
E/AndroidRuntime( 2994):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
E/AndroidRuntime( 2994):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
E/AndroidRuntime( 2994):    at android.app.ActivityThread.access$2300(ActivityThread.java:125)
E/AndroidRuntime( 2994):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
E/AndroidRuntime( 2994):    at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 2994):    at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime( 2994):    at android.app.ActivityThread.main(ActivityThread.java:4627)
E/AndroidRuntime( 2994):    at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 2994):    at java.lang.reflect.Method.invoke(Method.java:521)
E/AndroidRuntime( 2994):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
E/AndroidRuntime( 2994):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
E/AndroidRuntime( 2994):    at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 2994): Caused by: java.lang.SecurityException: Not allowed to bind to service Intent { cmp=de.ring0/.ToolkitService }
E/AndroidRuntime( 2994):    at android.app.ContextImpl.bindService(ContextImpl.java:874)
E/AndroidRuntime( 2994):    at android.content.ContextWrapper.bindService(ContextWrapper.java:347)
E/AndroidRuntime( 2994):    at de.ring0.example.tactilecompass.TactileCompassActivity.onCreate(TactileCompassActivity.java:28)
E/AndroidRuntime( 2994):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
E/AndroidRuntime( 2994):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
E/AndroidRuntime( 2994):    ... 11 more
W/ActivityManager(   59): Process de.ring0.example.tactilecompass has crashed too many times: killing!
W/ActivityManager(   59):   Force finishing activity de.ring0.example.tactilecompass/.TactileCompassActivity
I/Process (   59): Sending signal. PID: 2994 SIG: 9
</code></pre>
