diff --git a/lib/services/android-project-service.ts b/lib/services/android-project-service.ts index cd6ba04740..591f5c44bd 100644 --- a/lib/services/android-project-service.ts +++ b/lib/services/android-project-service.ts @@ -256,10 +256,12 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService public removePluginNativeCode(pluginData: IPluginData): IFuture { return (() => { let pluginPlatformsFolderPath = this.getPluginPlatformsFolderPath(pluginData, AndroidProjectService.ANDROID_PLATFORM_NAME); - let pluginJars = this.$fs.enumerateFilesInDirectorySync(path.join(pluginPlatformsFolderPath, AndroidProjectService.LIBS_FOLDER_NAME)); - let libsFolderPath = path.join(pluginPlatformsFolderPath, AndroidProjectService.LIBS_FOLDER_NAME); - _.each(pluginJars, jarName => this.$fs.deleteFile(path.join(libsFolderPath, jarName)).wait()); + + if(this.$fs.exists(libsFolderPath).wait()) { + let pluginJars = this.$fs.enumerateFilesInDirectorySync(libsFolderPath); + _.each(pluginJars, jarName => this.$fs.deleteFile(path.join(libsFolderPath, jarName)).wait()); + } }).future()(); }