title: Permission Denial: opening provider com.android.providers.contacts.ContactsProvider2
body: <p>I'm new to Android and I created an app from scratch using Android Studio and the LoginActivity template. I'm targeting SDK 23 and the min version is 15. Android Studio generated the following 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="com.uprope.uprope" &gt;
  
      &lt;!-- To auto-complete the email text field in the login form with the user's emails --&gt;
      &lt;uses-permission android:name="android.permission.GET_ACCOUNTS" /&gt;
      &lt;uses-permission android:name="android.permission.READ_PROFILE" /&gt;
      &lt;uses-permission android:name="android.permission.READ_CONTACTS" /&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=".LoginActivity"
              android:label="@string/app_name"
              android:windowSoftInputMode="adjustResize|stateVisible" &gt;
          &lt;/activity&gt;
      &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>
  
  <p>When I try to run the empty template, I get this stack trace: </p>
  
  <pre><code>E/AndroidRuntime﹕ FATAL EXCEPTION: AsyncTask #1
      Process: com.uprope.uprope, PID: 24790
      java.lang.RuntimeException: An error occurred while executing doInBackground()
              at android.os.AsyncTask$3.done(AsyncTask.java:309)
              at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
              at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
              at java.util.concurrent.FutureTask.run(FutureTask.java:242)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
              at java.lang.Thread.run(Thread.java:818)
       Caused by: java.lang.SecurityException: Permission Denial: opening provider com.android.providers.contacts.ContactsProvider2 from ProcessRecord{85980a6 24790:com.uprope.uprope/u0a58} (pid=24790, uid=10058) requires android.permission.READ_CONTACTS or android.permission.WRITE_CONTACTS
              at android.os.Parcel.readException(Parcel.java:1599)
              at android.os.Parcel.readException(Parcel.java:1552)
              at android.app.ActivityManagerProxy.getContentProvider(ActivityManagerNative.java:3550)
              at android.app.ActivityThread.acquireProvider(ActivityThread.java:4778)
              at android.app.ContextImpl$ApplicationContentResolver.acquireUnstableProvider(ContextImpl.java:2018)
              at android.content.ContentResolver.acquireUnstableProvider(ContentResolver.java:1468)
              at android.content.ContentResolver.query(ContentResolver.java:475)
              at android.content.CursorLoader.loadInBackground(CursorLoader.java:64)
              at android.content.CursorLoader.loadInBackground(CursorLoader.java:56)
              at android.content.AsyncTaskLoader.onLoadInBackground(AsyncTaskLoader.java:312)
              at android.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:69)
              at android.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:66)
              at android.os.AsyncTask$2.call(AsyncTask.java:295)
              at java.util.concurrent.FutureTask.run(FutureTask.java:237)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
              at java.lang.Thread.run(Thread.java:818)
  </code></pre>
  
  <p>What is causing this exception? </p>