You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2019/04/11 02:04:47 UTC

[GitHub] [cordova-android] phiferd edited a comment on issue #670: [8.0.0] Android environment variables: ANDROID_HOME vs ANDROID_SDK_ROOT

phiferd edited a comment on issue #670: [8.0.0] Android environment variables: ANDROID_HOME vs ANDROID_SDK_ROOT
URL: https://github.com/apache/cordova-android/issues/670#issuecomment-481936559
 
 
   This causes problems for me. The symptom is:
   
   ```
   > cordova build android
   
   ... (omitted for clarity)
   
   * Where:
   Script 'C:\Users\...\platforms\android\CordovaLib\cordova.gradle' line: 68
   
   * What went wrong:
   A problem occurred evaluating project ':app'.
   > No installed build tools found. Install the Android build tools version 19.1.0 or higher.
   
   ```
   
   In the generated cordova.gradle, the `getAndroidSdkDir()` function uses `ANDROID_HOME` rather than `ANDROID_SDK_ROOT`. The `maybeSetAndroidHome` function only overrides the android home value if it isn't already set.  That means that in the gradle routine, it will continue to use the deprecated value **even if the `ANDROID_SDK_ROOT` env variable is set.** 
   
   It's very counter intuitive that a deprecated value would take precedence over the non-deprecated value.
   
   At the very least, the error message should be improved, as it will lead people down the path of unintalling and reinstalling the build tools, which isn't the issue at all.  Maybe:
   
   `Could not find build tools in <DIRECTORY THAT WAS CHECKED>, ensure your ANDROID_SDK_ROOT env variable is set correctly and the ANDROID_HOME env variable is removed`
   
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org