Skip to content

Commit 354511e

Browse files
committed
Fixes gradle building for Android
Fixes #840
1 parent 065e3b1 commit 354511e

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lib/services/android-project-service.ts

+7-2
Original file line numberDiff line numberDiff line change
@@ -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', /__PACKAGE__/, this.$projectData.projectId, manifestPath);
142-
shell.sed('-i', /__APILEVEL__/, this.getApiLevel().wait(), manifestPath);
143142

144143
let stringsFilePath = path.join(this.platformData.appResourcesDestinationDirectoryPath, 'values', 'strings.xml');
145144
shell.sed('-i', /__NAME__/, 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

Comments
 (0)