@@ -120,7 +120,7 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
120120 }
121121
122122 public async validate ( projectData : IProjectData , options : IOptions , notConfiguredEnvOptions ?: INotConfiguredEnvOptions ) : Promise < IValidatePlatformOutput > {
123- this . validatePackageName ( projectData . projectId ) ;
123+ this . validatePackageName ( projectData . projectIdentifiers . android ) ;
124124 this . validateProjectName ( projectData . projectName ) ;
125125
126126 const checkEnvironmentRequirementsOutput = await this . $platformEnvironmentRequirements . checkEnvironmentRequirements ( {
@@ -269,16 +269,17 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
269269 // will replace applicationId in app/App_Resources/Android/app.gradle if it has not been edited by the user
270270 const appGradleContent = this . $fs . readText ( projectData . appGradlePath ) ;
271271 if ( appGradleContent . indexOf ( constants . PACKAGE_PLACEHOLDER_NAME ) !== - 1 ) {
272- shell . sed ( '-i' , new RegExp ( constants . PACKAGE_PLACEHOLDER_NAME ) , projectData . projectId , projectData . appGradlePath ) ;
272+ //TODO: For compatibility with old templates. Once all templates are updated should delete.
273+ shell . sed ( '-i' , new RegExp ( constants . PACKAGE_PLACEHOLDER_NAME ) , projectData . projectIdentifiers . android , projectData . appGradlePath ) ;
273274 }
274275 } catch ( e ) {
275- this . $logger . warn ( `\n ${ e } .\nCheck if you're using an outdated template and update it .`) ;
276+ this . $logger . trace ( `Templates updated and no need for replace in app.gradle .`) ;
276277 }
277278 }
278279
279280 public interpolateConfigurationFile ( projectData : IProjectData , platformSpecificData : IPlatformSpecificData ) : void {
280281 const manifestPath = this . getPlatformData ( projectData ) . configurationFilePath ;
281- shell . sed ( '-i' , / _ _ P A C K A G E _ _ / , projectData . projectId , manifestPath ) ;
282+ shell . sed ( '-i' , / _ _ P A C K A G E _ _ / , projectData . projectIdentifiers . android , manifestPath ) ;
282283 if ( this . $androidToolsInfo . getToolsInfo ( ) . androidHomeEnvVar ) {
283284 const sdk = ( platformSpecificData && platformSpecificData . sdk ) || ( this . $androidToolsInfo . getToolsInfo ( ) . compileSdkVersion || "" ) . toString ( ) ;
284285 shell . sed ( '-i' , / _ _ A P I L E V E L _ _ / , sdk , manifestPath ) ;
@@ -287,8 +288,8 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
287288
288289 private getProjectNameFromId ( projectData : IProjectData ) : string {
289290 let id : string ;
290- if ( projectData && projectData . projectId ) {
291- const idParts = projectData . projectId . split ( "." ) ;
291+ if ( projectData && projectData . projectIdentifiers && projectData . projectIdentifiers . android ) {
292+ const idParts = projectData . projectIdentifiers . android . split ( "." ) ;
292293 id = idParts [ idParts . length - 1 ] ;
293294 }
294295
@@ -532,7 +533,7 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
532533 const filesForInterpolation = this . $fs . enumerateFilesInDirectorySync ( resourcesDestinationDirectoryPath , file => this . $fs . getFsStats ( file ) . isDirectory ( ) || path . extname ( file ) === constants . XML_FILE_EXTENSION ) || [ ] ;
533534 for ( const file of filesForInterpolation ) {
534535 this . $logger . trace ( `Interpolate data for plugin file: ${ file } ` ) ;
535- await this . $pluginVariablesService . interpolate ( pluginData , file , projectData ) ;
536+ await this . $pluginVariablesService . interpolate ( pluginData , file , projectData . projectDir , projectData . projectIdentifiers . android ) ;
536537 }
537538 }
538539
@@ -642,7 +643,7 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
642643
643644 public async cleanDeviceTempFolder ( deviceIdentifier : string , projectData : IProjectData ) : Promise < void > {
644645 const adb = this . $injector . resolve ( DeviceAndroidDebugBridge , { identifier : deviceIdentifier } ) ;
645- const deviceRootPath = `${ LiveSyncPaths . ANDROID_TMP_DIR_NAME } /${ projectData . projectId } ` ;
646+ const deviceRootPath = `${ LiveSyncPaths . ANDROID_TMP_DIR_NAME } /${ projectData . projectIdentifiers . android } ` ;
646647 await adb . executeShellCommand ( [ "rm" , "-rf" , deviceRootPath ] ) ;
647648 }
648649
0 commit comments