{"action":"closed","issue":{"url":"https://api.github.com/repos/ionic-team/ionic-native/issues/2176","repository_url":"https://api.github.com/repos/ionic-team/ionic-native","labels_url":"https://api.github.com/repos/ionic-team/ionic-native/issues/2176/labels{/name}","comments_url":"https://api.github.com/repos/ionic-team/ionic-native/issues/2176/comments","events_url":"https://api.github.com/repos/ionic-team/ionic-native/issues/2176/events","html_url":"https://github.com/ionic-team/ionic-native/issues/2176","id":279280444,"number":2176,"title":"Issues with writeFile on Android","user":{"login":"casper123","id":2751821,"avatar_url":"https://avatars2.githubusercontent.com/u/2751821?v=4","gravatar_id":"","url":"https://api.github.com/users/casper123","html_url":"https://github.com/casper123","followers_url":"https://api.github.com/users/casper123/followers","following_url":"https://api.github.com/users/casper123/following{/other_user}","gists_url":"https://api.github.com/users/casper123/gists{/gist_id}","starred_url":"https://api.github.com/users/casper123/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/casper123/subscriptions","organizations_url":"https://api.github.com/users/casper123/orgs","repos_url":"https://api.github.com/users/casper123/repos","events_url":"https://api.github.com/users/casper123/events{/privacy}","received_events_url":"https://api.github.com/users/casper123/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-12-05T08:02:50Z","updated_at":"2018-03-18T21:08:45Z","closed_at":"2018-03-18T21:08:45Z","author_association":"NONE","body":"**I'm submitting a ...**  (check one with \"x\")\r\n[x] bug report\r\n\r\n**Current behaviour:**\r\nI am having issues with File.writeFile method. It works on iOS but doesn't work on Android. \r\nI am saving a blob using the code below\r\n\r\n```\r\nthis.file.resolveLocalFilesystemUrl(this.file.dataDirectory).then( (dir) => {\r\n console.log(\"Access to the directory granted succesfully\");\r\n            console.log(dir);\r\n            console.log(this.file.dataDirectory);\r\n            \r\n            let name = filename + \"template.html\";\r\n            console.log(name);\r\n            this.file.writeFile(this.file.dataDirectory, name, DataBlob, {replace:true}).then(\r\n              res => {\r\n                console.log(res);\r\n                return resolve(dir.fullPath);\r\n              },\r\n              error => {\r\n                console.log(error);  \r\n                return reject(error);\r\n              }\r\n            ).catch(error => {\r\n              console.log(error);  \r\n              return reject(error);\r\n            });\r\n          },\r\n          error => {\r\n            this.log('JTMTemplateDownload: savebase64, resolveLocalFilesystemUrl', error);\r\n            return reject(error);\r\n          });\r\n\r\n```\r\nThe above code works fine on iOS but on Android it never gets into promise function for first time. When I run app second time. It gives me `PATH_EXISTS_ERR`. I checked directory using file manager but no file exist on that specific path\r\n\r\n**Expected behavior:**\r\nIt should be writing file on given directory\r\n\r\n**Ionic info:** (run `ionic info` from a terminal/cmd prompt and paste output below):\r\ncli packages: (/Users/abdulwahab/Documents/mobileapps/JTMNew/itglobal2/node_modules)\r\n\r\n    @ionic/cli-utils  : 1.17.0\r\n    ionic (Ionic CLI) : 3.17.0\r\n\r\nglobal packages:\r\n\r\n    cordova (Cordova CLI) : 7.1.0 \r\n\r\nlocal packages:\r\n\r\n    @ionic/app-scripts : 2.1.4\r\n    Cordova Platforms  : android 6.2.3 ios 4.4.0\r\n    Ionic Framework    : ionic-angular 3.6.1\r\n\r\nSystem:\r\n\r\n    Android SDK Tools : 25.2.5\r\n    ios-deploy        : 1.9.2 \r\n    Node              : v8.4.0\r\n    npm               : 5.3.0 \r\n    OS                : macOS Sierra\r\n    Xcode             : Xcode 8.3.3 Build version 8E3004b \r\n\r\nEnvironment Variables:\r\n\r\n    ANDROID_HOME : /usr/local/Cellar/android-sdk/24.4.1_1\r\n\r\nMisc:\r\n\r\n    backend : legacy\r\n\r\n"}}
{"actor":{"display_login":"danielsogl"}}