@@ -139,7 +139,6 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
139139 // Interpolate the activity name and package
140140 let manifestPath = this . platformData . configurationFilePath ;
141141 shell . sed ( '-i' , / _ _ P A C K A G E _ _ / , this . $projectData . projectId , manifestPath ) ;
142- shell . sed ( '-i' , / _ _ A P I L E V E L _ _ / , this . getApiLevel ( ) . wait ( ) , manifestPath ) ;
143142
144143 let stringsFilePath = path . join ( this . platformData . appResourcesDestinationDirectoryPath , 'values' , 'strings.xml' ) ;
145144 shell . sed ( '-i' , / _ _ N A M E _ _ / , this . $projectData . projectName , stringsFilePath ) ;
@@ -178,7 +177,13 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
178177 public buildProject ( projectRoot : string , buildConfig ?: IBuildConfig ) : IFuture < void > {
179178 return ( ( ) => {
180179 if ( this . canUseGradle ( ) . wait ( ) ) {
181- let buildOptions = [ "buildapk" , `-PcompileSdk=${ this . getAndroidTarget ( ) . wait ( ) } ` ] ;
180+ // note, compileSdk and targetSdk should be the same
181+ let targetSdk = this . getAndroidTarget ( ) . wait ( ) . replace ( "android-" , "" ) ;
182+ let buildOptions = [ "buildapk" ,
183+ `-PcompileSdk=${ this . getAndroidTarget ( ) . wait ( ) } ` ,
184+ `-PtargetSdk=${ targetSdk } `
185+ ] ;
186+
182187 if ( this . $options . release ) {
183188 buildOptions . push ( "-Prelease" ) ;
184189 buildOptions . push ( `-PksPath=${ this . $options . keyStorePath } ` ) ;
0 commit comments