title: android.permission.READ_PHONE_STATE permission denied
body: <p>I get an exception which tell me that permission is denied to use <code>getDeviceId()</code> but I have <code>android.permission.READ_PHONE_STATE</code> in my manifest.</p>
  
  <p>Here is exception:</p>
  
  <p><code>getDeviceId: Neither user 10055 nor current process has android.permission.READ_PHONE_STATE.</code></p>
  
  <p>Here is manifest:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="client.test.me.client" &gt;
    &lt;uses-permission android:name="android.permission.INTERNET"/&gt;
    &lt;uses-permission android:name="android.permission.READ_PHONE_STATE"/&gt;
    &lt;uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/&gt;
    &lt;uses-permission android:name="android.permission.CALL_PHONE"/&gt;
    &lt;uses-permission android:name="android.permission.SEND_SMS"/&gt;
  
  
    &lt;application
     android:allowBackup="true"
     android:icon="@mipmap/ic_launcher"
     android:label="@string/app_name"
     android:theme="@style/AppTheme"&gt;
       &lt;activity
        android:name=".HiddenActivity"
        android:label="@string/app_name"
        android:theme="@android:style/Theme.Translucent.NoTitleBar"&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;receiver android:name=".BootReceiver"&gt;
          &lt;intent-filter&gt;
            &lt;action android:name="android.intent.action.BOOT_COMPLETED" /&gt;
            &lt;category android:name="android.intent.category.HOME" /&gt;
          &lt;/intent-filter&gt;
        &lt;/receiver&gt;
  
        &lt;service android:name="client.test.me.client.ClientService" &gt;
          &lt;intent-filter&gt;
            &lt;action android:name=".ClientService" /&gt;
          &lt;/intent-filter&gt;
        &lt;/service&gt;
    &lt;/application&gt;
  &lt;/manifest&gt;
  </code></pre>
  
  <p>build.gradle</p>
  
  <pre><code>apply plugin: 'com.android.application'
  
  android {
      compileSdkVersion 23
      buildToolsVersion "23.0.1"
  
      defaultConfig {
          applicationId "client.test.me.client"
          minSdkVersion 8
          targetSdkVersion 23
          versionCode 1
          versionName "1.0"
      }
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
      }
  }
  
  dependencies {
      compile fileTree(dir: 'libs', include: ['*.jar'])
      compile 'com.android.support:appcompat-v7:23.0.1'
  }
  </code></pre>
  
  <p>Code to get deviceId:</p>
  
  <pre><code>TelephonyManager tm = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
  
  byte[] idBytes = tm.getDeviceId().getBytes();
  </code></pre>
  
  <p>Edit: This is not a duplicate I can not find a question where they have the same problem as me.</p>