только предположение. Переменная REQUEST_CODE_PERMISSION_READ_CONTACTS объявлена?)
/**
* Id to identify a contacts permission request.
*/
private static final int REQUEST_CODE_PERMISSION_READ_CONTACTS = 0;
и ещё кусок
// Verify that all required contact permissions have been granted.
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.READ_CONTACTS) !=
PackageManager.PERMISSION_GRANTED ||
ActivityCompat.checkSelfPermission(this, Manifest.permission.WRITE_CONTACTS) !=
PackageManager.PERMISSION_GRANTED) {
// Contacts permissions have not been granted.
Log.i(TAG, "Contact permissions has NOT been granted. Requesting permissions.");
requestContactsPermissions();
}
Источник