diff --git a/lib/services/android-project-service.ts b/lib/services/android-project-service.ts index 8868de0dc4..6a66beccc3 100644 --- a/lib/services/android-project-service.ts +++ b/lib/services/android-project-service.ts @@ -296,18 +296,20 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject this.$fs.ensureDirectoryExists(configurationsDirectoryPath).wait(); let pluginConfigurationDirectoryPath = path.join(configurationsDirectoryPath, pluginName); - this.$fs.ensureDirectoryExists(pluginConfigurationDirectoryPath).wait(); + if (this.$fs.exists(pluginPlatformsFolderPath).wait()) { + this.$fs.ensureDirectoryExists(pluginConfigurationDirectoryPath).wait(); + + // Copy all resources from plugin + let resourcesDestinationDirectoryPath = path.join(this.platformData.projectRoot, "src", pluginName); + this.$fs.ensureDirectoryExists(resourcesDestinationDirectoryPath).wait(); + shell.cp("-Rf", path.join(pluginPlatformsFolderPath, "*"), resourcesDestinationDirectoryPath); + } // Copy include.gradle file let includeGradleFilePath = path.join(pluginPlatformsFolderPath, "include.gradle"); if(this.$fs.exists(includeGradleFilePath).wait()) { shell.cp("-f", includeGradleFilePath, pluginConfigurationDirectoryPath); } - - // Copy all resources from plugin - let resourcesDestinationDirectoryPath = path.join(this.platformData.projectRoot, "src", pluginName); - this.$fs.ensureDirectoryExists(resourcesDestinationDirectoryPath).wait(); - shell.cp("-Rf", path.join(pluginPlatformsFolderPath, "*"), resourcesDestinationDirectoryPath); }).future()(); }