Cordova File Plugin -> Not writing to application folder


#1

I try to create a folder with the Cordova File Plugin on the android-device. Without an error there is no folder on the storage after creating one.

ive added into config.xml:

<preference name="AndroidPersistentFileLocation" value="Internal" />

I open the filestystem like this:

function getFilesystem() {
var deferred = $q.defer();

    window.requestFileSystem(window.PERSISTENT, 1024*1024, function(filesystem) {
        deferred.resolve(filesystem);
    });
    
    return deferred.promise;

}

and than:
createDir: function(dir) {
var deferred = $q.defer();

        getFilesystem().then(
            function(filesystem) {
                alert("createDir: " + filesystem.root.toURL() + dir);
                
                filesystem.root.getDirectory(dir, {create: true}, 
                    function(dirData) { //File exist
                        deferred.resolve();
                    },
                    function() { //File dont exist
                        deferred.reject();
                    }
                );
            }
        );

        return deferred.promise;
    }
  1. There is no error.
  2. I found no folder inside my app folder (by default on android the path is -> android/data/com.myApp/files). I expect the folder to be inside it. But no new folder inside.
  3. And on filesystem.root.toURL() he is printing: file:///data/data/com.myApp/files/files/
  4. When i check if there is a folder exists, there is no folder. Nowhere.
  5. <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> is off course setted

Questions: What i am doing wrong. What is wrong?