Skip to content

fix: allow api level >= 35 instead of ==35 for android platformSetupCheck#154

Merged
ben-zhang-at-salesforce merged 3 commits intoforcedotcom:mainfrom
ben-zhang-at-salesforce:api35above
Feb 18, 2026
Merged

fix: allow api level >= 35 instead of ==35 for android platformSetupCheck#154
ben-zhang-at-salesforce merged 3 commits intoforcedotcom:mainfrom
ben-zhang-at-salesforce:api35above

Conversation

@ben-zhang-at-salesforce
Copy link
Contributor

platformSetupCheck for android is strictly checking the api/emulator level 35 is installed. It should be >= 35.

@ben-zhang-at-salesforce ben-zhang-at-salesforce requested a review from a team as a code owner February 3, 2026 01:36
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

created a separate android specific util class to hold these android unique methods: easy testing and isolation.

): {
allRequirementsMet: boolean;
errorMessages: string[];
tests: PlatformCheckResult['tests'];
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pass back the tests from the passed json.

}

const versionAtLeast = (pkg: { version: Version | string }) => {
if (typeof pkg.version === 'string') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to check version's type? Version.sameOrNewer has the first parameter as Version and string type already.

* for Android and replace with a direct >= apiLevel check (platform + emulator image).
* Values must match messages in @salesforce/lwc-dev-mobile-core (requirement-android.md).
*/
/** Titles of setup requirement checks we skip for Android (replaced by direct >= apiLevel check). */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should consolidate the above 2 doc comments into one

*/
/** Titles of setup requirement checks we skip for Android (replaced by direct >= apiLevel check). */
export const ANDROID_SETUP_REQUIREMENT_TITLES_TO_SKIP: readonly string[] = [
'Checking SDK Platform API',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a comment referencing where these titles come from in case upstream package changes its message text?

if (!hasPlatformAtLeast) {
return {
success: false,
errorMessage: `Android platform API for level ${apiLevel} or higher are required. No installed platform package found with version >= ${apiLevel}.`,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Should be 'is required'

Copy link
Contributor

@haifeng-li-at-salesforce haifeng-li-at-salesforce left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Great improvement!

@ben-zhang-at-salesforce ben-zhang-at-salesforce merged commit c2275d3 into forcedotcom:main Feb 18, 2026
12 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants