From 3bb6540bc7ae9fda600ac673c67d9747e2cd19e8 Mon Sep 17 00:00:00 2001 From: Fatme Havaluova Date: Thu, 3 Sep 2015 13:31:46 +0300 Subject: [PATCH] Fixes https://github.com/NativeScript/nativescript-cli/issues/860 --- lib/services/android-project-service.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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()(); }