$cordovaFile.checkDir says folder does not exist but $cordovaFile.createDir says folder already exists

I am trying to work with the ngCordova File plugin as documented here: http://ngcordova.com/docs/plugins/file/, but am getting strange behaviour.

I am trying to create a folder if it does not already exist. I am testing for its existence using:

$cordovaFile.checkDir(cordova.file.dataDirectory, 'inbound')

Now this returns NOT_FOUND_ERR so i try to create the folder subsequently by calling:

$cordovaFile.createDir(cordova.file.dataDirectory, 'inbound', false);

But this then returns PATH_EXISTS_ERR

Why would checkDir tell me it does not exist, but then createDir tell me it DOES exist?

NOTE: This is using an Android device.

Those are promises, are you using them like that :

$cordovaFile.checkDir(cordova.file.dataDirectory, "inbounds")
      .then(function (success) {
        // success
        alert("status " + success);


      }, function (error) {
        // error
      });

Have you configured your config.xml too ?

<preference name="iosExtraFilesystems" value="library,library-nosync,documents,documents-nosync,cache,bundle,root" />
<preference name="AndroidExtraFilesystems" value="files,files-external,documents,sdcard,cache,cache-external,root" />

OK, I am adding this as an answer although aorfevre started the whole ball rolling. The issue I had primarily was that I had not added the necessary lines to my config.xml file which provided access to the device's filesystem.

Although after doing this I still had issues the key thing I was doing wrong was building and redeploying the app over the top of the existing installation. As soon as I manually uninstalled the app and deployed it fresh, it started working fine.