title: Unable to scan for beacons
body: <p>I have been trying to scan for beacons, but I'm not able to. I tried all the StackOverflow questions but I haven't found an answer.</p>
  
  <p>Below is my code:</p>
  
  <p><strong>MAINACTIVITY:</strong></p>
  
  <pre><code>public class MainActivity extends AppCompatActivity implements BeaconConsumer {
  
  protected static final String TAG = "MonitoringActivity";
  private BeaconManager beaconManager;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  beaconManager = BeaconManager.getInstanceForApplication(this);
       beaconManager.getBeaconParsers().add(new BeaconParser().
              setBeaconLayout("m:2-3=beac,i:4-19,i:20-21,i:22-23,p:24-24,d:25-25"));
      beaconManager.bind(this);}
  
   @Override
  public void onBeaconServiceConnect() {
      beaconManager.addMonitorNotifier(new MonitorNotifier() {
          @Override
          public void didEnterRegion(Region region) {
              Log.i(TAG, "I just saw an beacon for the first time!");
          }
  
          @Override
          public void didExitRegion(Region region) {
              Log.i(TAG, "I no longer see an beacon");
          }
  
          @Override
          public void didDetermineStateForRegion(int state, Region region) {
              Log.i(TAG, "I have just switched from seeing/not seeing beacons: "+state);
          }
      });
  
      try {
          beaconManager.startMonitoringBeaconsInRegion(new Region("myMonitoringUniqueId", Identifier.parse(null, null, null));
      } catch (RemoteException e) {    }
  }
  </code></pre>
  
  <p><strong>MANIFEST</strong></p>
  
  <pre><code>&lt;uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/&gt;
  &lt;uses-permission android:name="android.permission.BLUETOOTH"/&gt;
  &lt;uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/&gt;
  </code></pre>
  
  <p><strong>gradle.properties</strong></p>
  
  <pre><code>manifestmerger.enabled=true
  </code></pre>
  
  <p><strong>logcat</strong></p>
  
  <pre><code>06-19 20:03:37.403 7459-7459/com.example.beaconscanner D/BeaconParser: Parsing beacon layout: m:2-3=beac,i:4-19,i:20-21,i:22-23,p:24-24,d:25-25
  
  06-19 20:03:37.796 7459-7459/com.example.beaconscanner I/MonitoringActivity: I have just switched from seeing/not seeing beacons: 0
  
  06-19 20:03:37.933 7459-7729/com.example.beaconscanner D/BluetoothAdapter: STATE_ON
  06-19 20:03:37.938 7459-7471/com.example.beaconscanner D/BluetoothLeScanner: onClientRegistered() - status=0 clientIf=12
  
  06-19 20:03:39.038 7459-7729/com.example.beaconscanner D/BluetoothAdapter: STATE_ON
  06-19 20:03:39.040 7459-7729/com.example.beaconscanner D/BluetoothAdapter: STATE_ON
  06-19 20:03:39.044 7459-7470/com.example.beaconscanner D/BluetoothLeScanner: onClientRegistered() - status=0 clientIf=12
  </code></pre>
  
  <p>I have added permissions for location and Bluetooth according to Android SDK greater than 23</p>