Skip to content

fix(windows): get gradle path with which command #1793

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 28, 2025

Conversation

erisu
Copy link
Member

@erisu erisu commented Mar 27, 2025

Motivation and Context

Resolves #1792

Description

Before Android Studio 3.5, Gradle was bundled with the IDE.

In the past, for Windows environments, we attempted to locate the Android Studio installation path to use its bundled Gradle executable.

However, Cordova has not supported old versions of Android Studio for a long time, making this logic obsolete. Additionally, past release announcements have indicated increasing Android Studio requirements:

  • Cordova-Android 13 required a minimum of Android Studio Jellyfish.
  • Cordova-Android 14 required a minimum of Android Studio Ladybug.

Documentation also stated that since Cordova-Android 6.4.0, a system-level Gradle installation is required. Cordova would then uses this to generate the project-level Gradle wrapper.

Given these changes, this PR will remove the outdated Windows-specific logic. The .bat file will remain for now but will be removed in the next major release.

Testing

  • Create cordova project in a directory with spaces
  • Added cordova platform which contains this PR changes.
  • Built app with cordova build android command on Windows.

Checklist

  • I've run the tests to see all new and existing tests pass
  • I added automated test coverage as appropriate for this change
  • Commit is prefixed with (platform) if this change only applies to one platform (e.g. (android))
  • If this Pull Request resolves an issue, I linked to the issue in the text above (and used the correct keyword to close issues using keywords)
  • I've updated the documentation if necessary

@erisu erisu added the bug label Mar 27, 2025
@erisu erisu added this to the 14.0.1 milestone Mar 27, 2025
@codecov-commenter
Copy link

codecov-commenter commented Mar 27, 2025

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 72.58%. Comparing base (1d82a3b) to head (e514478).
Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
lib/check_reqs.js 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1793      +/-   ##
==========================================
+ Coverage   71.89%   72.58%   +0.68%     
==========================================
  Files          23       23              
  Lines        1854     1835      -19     
==========================================
- Hits         1333     1332       -1     
+ Misses        521      503      -18     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@erisu erisu merged commit f697ca7 into apache:master Mar 28, 2025
8 checks passed
@erisu erisu deleted the fix/remove-get-android-studio-call branch March 28, 2025 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cordova 14 build fails when running from a directory with a space in the path
4 participants