Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

SDK location not found error while Running writeProjectInfo script

Deleted user January 21, 2019

Hi,

I want to run "set ANDROID_HOME = $(bamboo.ANDROID_HOME) gradlew writeProjectInfo" script in a task bu I got "SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable." error. I write "sdk.dir = C=\\Users\\myName\\AppData\\Local\\Android\\Sdk" in my local.properties file in my project bu it does not worked. What is the reason if this error? How can I fix?

Thanks.

2 answers

0 votes
Jim Coder
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 11, 2022

While writing a programme or setting up a project, there may be a lot of errors in the code. For example, the path to the project's local.properties file is not set.
The file Local.properties is missing from the project folder, and your sdk path is not configured in an environment variable.
This error message can also be caused by several lines in the local.properties file.   Refer to https://kodlogs.net/330/sdk-location-not-found-define-location-with-sdk-dir-in-the-local-properties#why

0 votes
Daniel Santos
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 22, 2019

Hi @[deleted],

  • Can you share in what task you are running setting the below command?
    set ANDROID_HOME = $(bamboo.ANDROID_HOME) gradlew writeProjectInfo
    I'm asking that because there is a mix between Windows and Linux way of treating variables. Windows variables should be evaluated like:
    %BAMBOO_<MY_VAR>% 
    so on a windows agents it would be:
    set ANDROID_HOME = %BAMBOO_ANDROID_HOME% gradlew writeProjectInfo
  •  Can you please adjust the sdk.dir line from local.properties file so it looks like the one below?
    sdk.dir = C:/Users/myName/AppData/Local/Android/Sdk
    Java applications usually interpret forward slashes as path separators too and this will save you from using extra characters. It was also strange to me that you had a an equal sign "=" instead of a colon ":", maybe just a typo.

Please notice that I'm not an expert on gradle, but I'm trying to give you some tips so you can move on.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events