erisu commented on PR #1795:
URL: https://github.com/apache/cordova-android/pull/1795#issuecomment-2764678803

   This PR only focuses on resolving the issue with cordova build. Running 
cordova build should properly detect JAVA_HOME and update the gradle config.
   
   However, this PR does not address cases if users open Android Studio first. 
In that scenario, it's expected that you'll see a warning on the first load, 
and then Android Studio configures the java.home with JBR.
   
   Ideally, running cordova build first shouldn’t be a requirement—users should 
be able to just open Android Studio. But unfortunately, fixing the issue where 
JBR is configured on first launch is not something that might be resolved until 
next major release.
   
   Currently, Cordova doesn’t create the Gradle wrapper until the project is 
built using the Cordova command. As far as I remember, it has always worked 
this way.
   
   To support opening a project in Android Studio immediately after adding the 
platform, Cordova would need to move the Gradle wrapper build process earlier 
in the workflow—perhaps at the end of platform add, or even during prepare, 
since that runs after adding a platform. If on prepare, it would also trigger 
on every plugin add, unfortunately.
   
   Hook scripts already allow users to run custom scripts during key phases, 
like after_platform_add and before_compile. If we could also execute the Gradle 
wrapper build at these points, that would be ideal—but again, this would 
require major changes.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org

Reply via email to