Skip to content

Commit b024f0f

Browse files
committed
fix behavior with old templates
when there's an old template with missing app.gradle there's an error on copy added a verbose log that helps the user take care of updating the template
1 parent f718c3e commit b024f0f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/services/android-project-service.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,11 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
190190

191191
// will replace applicationId in app/App_Resources/Android/app.gradle if it has not been edited by the user
192192
let userAppGradleFilePath = path.join(this.$projectData.appResourcesDirectoryPath, this.$devicePlatformsConstants.Android, "app.gradle");
193-
shell.sed('-i', /__PACKAGE__/, this.$projectData.projectId, userAppGradleFilePath);
193+
try {
194+
shell.sed('-i', /__PACKAGE__/, this.$projectData.projectId, userAppGradleFilePath);
195+
} catch(e) {
196+
this.$errors.failWithoutHelp(` Error: ${e}.\nIt's possible you're using an old template. You can try updating it and try again.`);
197+
}
194198
}).future<void>()();
195199
}
196200

0 commit comments

Comments
 (0)