Skip to content

Commit d3101d9

Browse files
authored
Merge pull request #2381 from NativeScript/plamen5kov/old_template_verbose_fail
fix behavior with old templates
2 parents f718c3e + 5845f0f commit d3101d9

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

lib/services/android-project-service.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,13 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
116116
} else {
117117
this.copy(this.platformData.projectRoot, frameworkDir, "src", "-R");
118118
}
119-
this.copy(this.platformData.projectRoot, frameworkDir, "build.gradle settings.gradle gradle.properties build-tools", "-Rf");
119+
this.copy(this.platformData.projectRoot, frameworkDir, "build.gradle settings.gradle build-tools", "-Rf");
120+
121+
try {
122+
this.copy(this.platformData.projectRoot, frameworkDir, "gradle.properties", "-Rf");
123+
} catch(e) {
124+
this.$logger.warn(`\n${e}\nIt's possible, the final .apk file will contain all architectures instead of the ones described in the abiFilters!\nYou can fix this by using the latest android platform.`);
125+
}
120126

121127
this.copy(this.platformData.projectRoot, frameworkDir, "gradle", "-R");
122128
this.copy(this.platformData.projectRoot, frameworkDir, "gradlew gradlew.bat", "-f");
@@ -190,7 +196,11 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
190196

191197
// will replace applicationId in app/App_Resources/Android/app.gradle if it has not been edited by the user
192198
let userAppGradleFilePath = path.join(this.$projectData.appResourcesDirectoryPath, this.$devicePlatformsConstants.Android, "app.gradle");
193-
shell.sed('-i', /__PACKAGE__/, this.$projectData.projectId, userAppGradleFilePath);
199+
try {
200+
shell.sed('-i', /__PACKAGE__/, this.$projectData.projectId, userAppGradleFilePath);
201+
} catch(e) {
202+
this.$logger.warn(`\n${e}.\nIt's possible you're using an old template.`);
203+
}
194204
}).future<void>()();
195205
}
196206

0 commit comments

Comments
 (0)