{"action":"created","issue":{"url":"https://api.github.com/repos/expo/expo/issues/2050","repository_url":"https://api.github.com/repos/expo/expo","labels_url":"https://api.github.com/repos/expo/expo/issues/2050/labels{/name}","comments_url":"https://api.github.com/repos/expo/expo/issues/2050/comments","events_url":"https://api.github.com/repos/expo/expo/issues/2050/events","html_url":"https://github.com/expo/expo/issues/2050","id":346059844,"node_id":"MDU6SXNzdWUzNDYwNTk4NDQ=","number":2050,"title":"[android] makeDirectoryAsync() succeeds, but still returns error \"could not be created\"","user":{"login":"kelvinlawson","id":118135,"node_id":"MDQ6VXNlcjExODEzNQ==","avatar_url":"https://avatars1.githubusercontent.com/u/118135?v=4","gravatar_id":"","url":"https://api.github.com/users/kelvinlawson","html_url":"https://github.com/kelvinlawson","followers_url":"https://api.github.com/users/kelvinlawson/followers","following_url":"https://api.github.com/users/kelvinlawson/following{/other_user}","gists_url":"https://api.github.com/users/kelvinlawson/gists{/gist_id}","starred_url":"https://api.github.com/users/kelvinlawson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kelvinlawson/subscriptions","organizations_url":"https://api.github.com/users/kelvinlawson/orgs","repos_url":"https://api.github.com/users/kelvinlawson/repos","events_url":"https://api.github.com/users/kelvinlawson/events{/privacy}","received_events_url":"https://api.github.com/users/kelvinlawson/received_events","type":"User","site_admin":false},"labels":[{"id":598253983,"node_id":"MDU6TGFiZWw1OTgyNTM5ODM=","url":"https://api.github.com/repos/expo/expo/labels/project:%20android-runtime","name":"project: android-runtime","color":"fbca04","default":false},{"id":598255371,"node_id":"MDU6TGFiZWw1OTgyNTUzNzE=","url":"https://api.github.com/repos/expo/expo/labels/project:%20sdk","name":"project: sdk","color":"d4c5f9","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-07-31T07:01:29Z","updated_at":"2018-08-02T00:35:09Z","closed_at":null,"author_association":"NONE","body":"### Environment\r\n\r\n<!-- In your terminal run `exp diagnostics` and paste the output here. -->\r\n\r\nEnvironment:\r\n  OS: macOS High Sierra 10.13.5\r\n  Node: 7.6.0\r\n  Yarn: 1.3.2\r\n  npm: 4.6.1\r\n  Watchman: 4.7.0\r\n  Xcode: Xcode 9.4 Build version 9F1027a\r\n  Android Studio: 2.3 AI-162.4069837\r\n\r\nPackages: (wanted => installed)\r\n  expo: ^28.0.0 => 28.0.0\r\n  react: 16.3.1 => 16.3.1\r\n  react-native: https://github.com/expo/react-native/archive/sdk-28.0.0.tar.gz => 0.55.4\r\n\r\n<!-- Please also let us know about your app's target (iOS, Android, Client, Standalone, ExpoKit) -->\r\n\r\nHave only seen the problem on Android so far. Standalone release build downloaded through Play store.\r\n\r\n### Steps to Reproduce\r\n\r\n<!--\r\n  How would you describe your issue to someone who doesn’t know you or your project?\r\n  Try to write a sequence of steps that anybody can repeat to see the issue.\r\n  Be specific! If the bug cannot be reproduced, your issue may be closed.\r\n-->\r\n\r\n(Write your steps here:)\r\n\r\n1. Create a directory with makeDirectoryAsync()\r\n\r\n### Expected Behavior\r\n\r\n<!--\r\n  How did you expect your project to behave?\r\n  It’s fine if you’re not sure your understanding is correct.\r\n  Just write down what you thought would happen.\r\n-->\r\n\r\nExpect to receive no error.\r\n\r\n### Actual Behavior\r\n\r\n<!--\r\n  Did something go wrong?\r\n  Is something broken, or not behaving as you expected?\r\n  Describe this section in detail, and attach screenshots if possible.\r\n  Don't just say \"it doesn't work\"!\r\n-->\r\n\r\nmakeDirectoryAsync() often returns \"Error\" ... \"could not be created\". However if I check getInfoAsync() after receiving the error, the directory is actually created.\r\n\r\nThe last Sentry report about this showed it was a Cubit X15 phone, Android 22.\r\n\r\n### Reproducible Demo\r\n\r\n<!--\r\n  Please share a project that reproduces the issue.\r\n  There are two ways to do it:\r\n\r\n    * Create a new app using https://snack.expo.io/ and try to reproduce the issue in it.\r\n      This is useful if you roughly know where the problem is, or can’t share the real code.\r\n\r\n    * Or, copy your app and remove things until you’re left with the minimal reproducible demo.\r\n      This is useful for finding the root cause. You may then optionally create a Snack.\r\n\r\n  This is a good guide to creating bug demos: https://stackoverflow.com/help/mcve\r\n  Once you’re done, copy and paste the link to the Snack or a public GitHub repository below:\r\n-->\r\n\r\n```\r\n// Create any app folders that don't already exist\r\nexport const checkAndCreateFolder = async folder_path => {\r\n  const folder_info = await Expo.FileSystem.getInfoAsync(folder_path);\r\n  if (!Boolean(folder_info.exists)) {\r\n    // Create folder\r\n    try {\r\n      await FileSystem.makeDirectoryAsync(folder_path, {\r\n        intermediates: true\r\n      });\r\n    } catch (error) {\r\n      // Report folder creation error, include the folder existence before and now\r\n      const new_folder_info = await Expo.FileSystem.getInfoAsync(folder_path);\r\n      const debug = `checkAndCreateFolder: ${\r\n        error.message\r\n      } old:${JSON.stringify(folder_info)} new:${JSON.stringify(\r\n        new_folder_info\r\n      )}`;\r\n      console.log(debug);\r\n      Sentry.captureException(new Error(debug));\r\n    }\r\n  }\r\n};\r\n```\r\n\r\nThe Sentry reports show that before creation getInfoAsync() returned:\r\n```\r\n{\"isDirectory\":false,\"exists\":false}\r\n```\r\n\r\nAnd after makeDirectoryAsync() failed and returned “could not be created” getInfoAsync() shows it actually exists:\r\n```\r\n{\"size\":4096,\"modificationTime\":1532552616,\"uri\":\"file:///data/data/com.test.test/files/ExperienceData/%2540test%252Ftest/subfolder\",\"isDirectory\":true,\"exists\":true}\r\n```\r\n\r\n<!--\r\n  What happens if you skip this step?\r\n\r\n  Someone will read your bug report, and maybe will be able to help you,\r\n  but it’s unlikely that it will get much attention from the team. Eventually,\r\n  the issue will likely get closed in favor of issues that have reproducible demos.\r\n\r\n  Please remember that:\r\n\r\n    * Issues without reproducible demos have a very low priority.\r\n    * The person fixing the bug would have to do that anyway. Please be respectful of their time.\r\n    * You might figure out the issues yourself as you work on extracting it.\r\n\r\n  Thanks for helping us help you!\r\n-->\r\n"},"comment":{"url":"https://api.github.com/repos/expo/expo/issues/comments/409768016","html_url":"https://github.com/expo/expo/issues/2050#issuecomment-409768016","issue_url":"https://api.github.com/repos/expo/expo/issues/2050","id":409768016,"node_id":"MDEyOklzc3VlQ29tbWVudDQwOTc2ODAxNg==","user":{"login":"esamelson","id":19958240,"node_id":"MDQ6VXNlcjE5OTU4MjQw","avatar_url":"https://avatars1.githubusercontent.com/u/19958240?v=4","gravatar_id":"","url":"https://api.github.com/users/esamelson","html_url":"https://github.com/esamelson","followers_url":"https://api.github.com/users/esamelson/followers","following_url":"https://api.github.com/users/esamelson/following{/other_user}","gists_url":"https://api.github.com/users/esamelson/gists{/gist_id}","starred_url":"https://api.github.com/users/esamelson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/esamelson/subscriptions","organizations_url":"https://api.github.com/users/esamelson/orgs","repos_url":"https://api.github.com/users/esamelson/repos","events_url":"https://api.github.com/users/esamelson/events{/privacy}","received_events_url":"https://api.github.com/users/esamelson/received_events","type":"User","site_admin":false},"created_at":"2018-08-02T00:35:09Z","updated_at":"2018-08-02T00:35:09Z","author_association":"MEMBER","body":"Hmmm okay. Even if it's only reproducible in a standalone build, a snack with the minimum amount of code needed to repro it would be super helpful. (I can just use it to make my own standalone app.)"}}
{"actor":{"display_login":"esamelson"}}