@@ -130,7 +130,7 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
130
130
}
131
131
132
132
public async validate ( projectData : IProjectData ) : Promise < void > {
133
- this . validatePackageName ( projectData . projectId ) ;
133
+ this . validatePackageName ( projectData . projectIdentifiers . android ) ;
134
134
this . validateProjectName ( projectData . projectName ) ;
135
135
136
136
await this . $platformEnvironmentRequirements . checkEnvironmentRequirements ( this . getPlatformData ( projectData ) . normalizedPlatformName ) ;
@@ -256,15 +256,16 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
256
256
257
257
try {
258
258
// will replace applicationId in app/App_Resources/Android/app.gradle if it has not been edited by the user
259
- shell . sed ( '-i' , / _ _ P A C K A G E _ _ / , projectData . projectId , projectData . appGradlePath ) ;
259
+ //TODO: For compatibility with old templates. Once all templates are updated should delete.
260
+ shell . sed ( '-i' , / _ _ P A C K A G E _ _ / , projectData . projectIdentifiers . android , projectData . appGradlePath ) ;
260
261
} catch ( e ) {
261
- this . $logger . warn ( `\n ${ e } .\nCheck if you're using an outdated template and update it .`) ;
262
+ this . $logger . trace ( `Templates updated and no need for replace in app.gradle .`) ;
262
263
}
263
264
}
264
265
265
266
public interpolateConfigurationFile ( projectData : IProjectData , platformSpecificData : IPlatformSpecificData ) : void {
266
267
const manifestPath = this . getPlatformData ( projectData ) . configurationFilePath ;
267
- shell . sed ( '-i' , / _ _ P A C K A G E _ _ / , projectData . projectId , manifestPath ) ;
268
+ shell . sed ( '-i' , / _ _ P A C K A G E _ _ / , projectData . projectIdentifiers . android , manifestPath ) ;
268
269
if ( this . $androidToolsInfo . getToolsInfo ( ) . androidHomeEnvVar ) {
269
270
const sdk = ( platformSpecificData && platformSpecificData . sdk ) || ( this . $androidToolsInfo . getToolsInfo ( ) . compileSdkVersion || "" ) . toString ( ) ;
270
271
shell . sed ( '-i' , / _ _ A P I L E V E L _ _ / , sdk , manifestPath ) ;
@@ -273,8 +274,8 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
273
274
274
275
private getProjectNameFromId ( projectData : IProjectData ) : string {
275
276
let id : string ;
276
- if ( projectData && projectData . projectId ) {
277
- const idParts = projectData . projectId . split ( "." ) ;
277
+ if ( projectData && projectData . projectIdentifiers && projectData . projectIdentifiers . android ) {
278
+ const idParts = projectData . projectIdentifiers . android . split ( "." ) ;
278
279
id = idParts [ idParts . length - 1 ] ;
279
280
}
280
281
@@ -511,7 +512,7 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
511
512
const filesForInterpolation = this . $fs . enumerateFilesInDirectorySync ( resourcesDestinationDirectoryPath , file => this . $fs . getFsStats ( file ) . isDirectory ( ) || path . extname ( file ) === constants . XML_FILE_EXTENSION ) || [ ] ;
512
513
for ( const file of filesForInterpolation ) {
513
514
this . $logger . trace ( `Interpolate data for plugin file: ${ file } ` ) ;
514
- await this . $pluginVariablesService . interpolate ( pluginData , file , projectData ) ;
515
+ await this . $pluginVariablesService . interpolate ( pluginData , file , projectData . projectDir , projectData . projectIdentifiers . android ) ;
515
516
}
516
517
}
517
518
@@ -618,7 +619,7 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
618
619
619
620
public async cleanDeviceTempFolder ( deviceIdentifier : string , projectData : IProjectData ) : Promise < void > {
620
621
const adb = this . $injector . resolve ( DeviceAndroidDebugBridge , { identifier : deviceIdentifier } ) ;
621
- const deviceRootPath = `/data/local/tmp/${ projectData . projectId } ` ;
622
+ const deviceRootPath = `/data/local/tmp/${ projectData . projectIdentifiers . android } ` ;
622
623
await adb . executeShellCommand ( [ "rm" , "-rf" , deviceRootPath ] ) ;
623
624
}
624
625
0 commit comments