breautek commented on issue #1585:
URL: 
https://github.com/apache/cordova-android/issues/1585#issuecomment-1506757088

   > in 
https://cordova.apache.org/docs/en/11.x/guide/platforms/android/index.html#android-sdk-tools
 the cmdline-tools should be added as required package. It is missing in the 
fresh install of the latest Android Studio.
   
   Thanks for the pointing this out. It's documented for the PATH, but it's 
definitely unclear where cmdline-tools comes from. I'll create an issue in our 
docs for this.
   
   > Also the guide suggests adding $ANDROID_SDK besides $ANDROID_HOME - I 
wonder why both are required when they point to the same path man_shrugging
   
   There is some history here. Google/Android team historically used 
`$ANDROID_HOME` for all their tooling. One day they deprecated this variable 
and suggested to start using `$ANDROID_SDK_ROOT`. Since then, they've done a 
180 and undeprecated `$ANDROID_HOME` and deprecated `$ANDROID_SDK_ROOT`. I 
suspect because there is a lot of external/third-party tooling (Including 
Cordova) that really depends on this variable and lots of people raised 
complaints.
   
   Current versions of Cordova will primarily look for `$ANDROID_SDK_ROOT` and 
fallback to `$ANDROID_HOME`, hence the 11.x docs suggest using 
`$ANDROID_SDK_ROOT`. This is however being changed (again) in the next major of 
cordova-android.
   
   So I'd recommend setting both variables like this in (Unix/Bash Environment):
   
   ```
   export ANDROID_HOME="path/to/android/sdk"
   export ANDROID_SDK_ROOT=$ANDROID_HOME
   ```
   
   I believe android tooling will use `ANDROID_HOME` primarily, and it will 
check if `ANDROID_SDK_ROOT` is set, and if so it will enforce (potentially by 
throwing an error) if it's not the same as `ANDROID_HOME`


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to