From 9075b883316bd7807b9b26991aaf9b22fd83ca1c Mon Sep 17 00:00:00 2001 From: fatme Date: Sat, 15 Jun 2019 12:03:34 +0300 Subject: [PATCH 1/2] fix: fix the way android appResources are processed Currently we copy all App_Resources from ./app/App_Resources/Android/* to ./platforms/../app/src. As there is src folder in ./app/App_Resources/Android/*, we receive as a result inside platforms ./platforms/app/../src/src. --- lib/services/android-project-service.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/services/android-project-service.ts b/lib/services/android-project-service.ts index cea0b9ec23..e96984a368 100644 --- a/lib/services/android-project-service.ts +++ b/lib/services/android-project-service.ts @@ -289,8 +289,8 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject this.$fs.ensureDirectoryExists(platformsAppResourcesPath); - this.$fs.copyFile(path.join(projectAppResourcesPath, platformData.normalizedPlatformName, "*"), platformsAppResourcesPath); - const appResourcesDirStructureHasMigrated = this.$androidResourcesMigrationService.hasMigrated(projectAppResourcesPath); + this.$fs.copyFile(path.join(projectAppResourcesPath, platformData.normalizedPlatformName, "*"), path.dirname(platformsAppResourcesPath)); + const appResourcesDirStructureHasMigrated = this.$androidResourcesMigrationService.hasMigrated(projectAppResourcesPath); if (appResourcesDirStructureHasMigrated) { this.$fs.copyFile(path.join(projectAppResourcesPath, platformData.normalizedPlatformName, "src", "*"), platformsAppResourcesPath); } else { From 2f214b6dd04d9f9503359f62f730cdda11a6e04c Mon Sep 17 00:00:00 2001 From: rosen-vladimirov Date: Tue, 18 Jun 2019 10:20:45 +0300 Subject: [PATCH 2/2] fix: copy Android App_Resources only once Currently, in case the Android's App_Resources structure is migrated, we copy the files twice. Fix this by setting correct folders to copy the files. --- lib/services/android-project-service.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/services/android-project-service.ts b/lib/services/android-project-service.ts index e96984a368..e6e8c362e6 100644 --- a/lib/services/android-project-service.ts +++ b/lib/services/android-project-service.ts @@ -289,11 +289,11 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject this.$fs.ensureDirectoryExists(platformsAppResourcesPath); - this.$fs.copyFile(path.join(projectAppResourcesPath, platformData.normalizedPlatformName, "*"), path.dirname(platformsAppResourcesPath)); const appResourcesDirStructureHasMigrated = this.$androidResourcesMigrationService.hasMigrated(projectAppResourcesPath); if (appResourcesDirStructureHasMigrated) { - this.$fs.copyFile(path.join(projectAppResourcesPath, platformData.normalizedPlatformName, "src", "*"), platformsAppResourcesPath); + this.$fs.copyFile(path.join(projectAppResourcesPath, platformData.normalizedPlatformName, constants.SRC_DIR, "*"), platformsAppResourcesPath); } else { + this.$fs.copyFile(path.join(projectAppResourcesPath, platformData.normalizedPlatformName, "*"), platformsAppResourcesPath); // https://github.com/NativeScript/android-runtime/issues/899 // App_Resources/Android/libs is reserved to user's aars and jars, but they should not be copied as resources this.$fs.deleteDirectory(path.join(platformsAppResourcesPath, "libs"));