Skip to content

Commit

Permalink
fix: set compile sdk when null
Browse files Browse the repository at this point in the history
  • Loading branch information
erisu committed May 16, 2022
1 parent bae5134 commit 42b971e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lib/prepare.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ function updateUserProjectGradleConfig (project) {
projectGradleConfig.SDK_VERSION
);

projectGradleConfig.COMPILE_SDK_VERSION = projectGradleConfig.COMPILE_SDK_VERSION || projectGradleConfig.SDK_VERSION;

// Write out changes
const projectGradleConfigPath = path.join(project.root, 'cdv-gradle-config.json');
fs.writeJSONSync(projectGradleConfigPath, projectGradleConfig, { spaces: 2 });
Expand Down
7 changes: 6 additions & 1 deletion templates/project/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,12 @@ android {
maxSdkVersion cordovaConfig.MAX_SDK_VERSION
}
targetSdkVersion cordovaConfig.SDK_VERSION
compileSdkVersion cordovaConfig.COMPILE_SDK_VERSION

if (cordovaConfig.COMPILE_SDK_VERSION != null) {
compileSdkVersion cordovaConfig.COMPILE_SDK_VERSION
} else {
compileSdkVersion cordovaConfig.SDK_VERSION
}
}

lintOptions {
Expand Down

0 comments on commit 42b971e

Please sign in to comment.