# Both BLE & BluetoothLE plugins seem not to be loaded at all

**URL:** <https://forum.ionicframework.com/t/both-ble-bluetoothle-plugins-seem-not-to-be-loaded-at-all/176776>\
**Category:** cordova\
**Created:** [November 2, 2019, 9:13pm UTC](https://forum.ionicframework.com/t/both-ble-bluetoothle-plugins-seem-not-to-be-loaded-at-all/176776 "2019-11-02T21:13:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![arronar](https://avatars.discourse-cdn.com/v4/letter/a/9f8e36/32.png) [@arronar](https://forum.ionicframework.com/u/arronar)\
**Post date:** [November 2, 2019, 9:13pm UTC](https://forum.ionicframework.com/t/both-ble-bluetoothle-plugins-seem-not-to-be-loaded-at-all/176776/1 "2019-11-02T21:13:28Z")

</div>

Hi there!  
I just arrived to Ionic framework because I’m using angular framework and I wanted to build a simple bluetooth application. My problem is that while I have used both BLE and BluetoothLE plugins, when trying to install my app I got no warning that the current app is using bluetooth and needs my permissions to use it.

The target Android version that I want to use is the 9 and thus I installed the 28 Android SDK and added the following lines to my config.xml

```auto
 <platform name="android">
        <preference name="android-minSdkVersion" value="27" />
        <preference name="android-targetSdkVersion" value="28" />
        ...

```

The I installed the BLE plugin using the commands that docs suggest and after running them I realized that there was no corresponding plugin entry to the config.xml (Is that expected). So I added on at the end like this

`<plugin name="cordova-plugin-ble-central" spec="1.2.4" />`

Then I imported at one of my modules the following line `import { BLE } from '@ionic-native/ble/ngx';` and I added the BLE also to the providers list of the same module.

Finally I created a service of mine which is imported at a specific page and contains:

```auto
import { Injectable } from '@angular/core';
import { LogsService } from '@services/logs.service';
import { BLE } from '@ionic-native/ble/ngx';

@Injectable({
  providedIn: 'root'
})
export class BluetoothService {

  constructor(
    private logs: LogsService,
    private ble: BLE
  ) {
    this.initializeBluetooth();
  }

  initializeBluetooth() {
    this.logs.add('initializing BLE...');
     this.ble.scan([], 5)
     .subscribe(
       device => this.logs.add(JSON.stringify(device)),
       error => this.logs.add(JSON.stringify(error))
     );
  }
}

```

I tried the same with BluetoothLE plugin with some changes in the config.xml and the service files.

At the end I’m running `ionic cordova build android --debug` to produce an apk file that I’m using it to install it to my device (Samsung A20e)

At logs I can see the Initializing BLE… text but nothing else. Never asked for bluetooth permissions or to turn it on.

So am I missing something? Am I doing something that wrong? I tried many different combinations in order to figure out what is happening but no luck so far.

Any idea or suggestion would be appreciated.

---

<div class="post-metadata">

**Author:** ![rapropos](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/rapropos/32/100227_2.png) [@rapropos](https://forum.ionicframework.com/u/rapropos)\
**Post date:** [November 2, 2019, 10:24pm UTC](https://forum.ionicframework.com/t/both-ble-bluetoothle-plugins-seem-not-to-be-loaded-at-all/176776/2 "2019-11-02T22:24:46Z")

</div>

If you’re new to Ionic, you may wish to at least look at [Capacitor](https://capacitor.ionicframework.com/docs/getting-started/) as an alternative to Cordova. In any event, I suspect you may need to wait for [`Platform.ready()`](https://ionicframework.com/docs/utilities/platform) to resolve before attempting to interact with the BLE plugin.
