diff --git a/android/src/main/java/cn/reactnative/modules/update/DownloadTask.java b/android/src/main/java/cn/reactnative/modules/update/DownloadTask.java index 5c13c2c..dbacaed 100644 --- a/android/src/main/java/cn/reactnative/modules/update/DownloadTask.java +++ b/android/src/main/java/cn/reactnative/modules/update/DownloadTask.java @@ -61,7 +61,7 @@ class DownloadTask extends AsyncTask { removeDirectory(f); } } - if (!file.delete()) { + if (file.exists() && !file.delete()) { throw new IOException("Failed to delete directory"); } }