Cannot find Platform source tree in parent of directory

675 Views Asked by At

Updated my shell script using $ nano ~/.bash_profile added following lines export PATH=~/directory/.jiri_root/bin:$PATH source ~/directory/scripts/fx-env.sh

The problem I'm getting is whenever I'm trying to run fx command I'm getting an error message "Cannot find Platform source tree in parent of directory". I have to use $ fx set product.board but error is displayed.

1

There are 1 best solutions below

0
On

This means that your current working directory is outside of the Fuchsia tree. You must run these commands from the top-level directory of the tree or a subdirectory. For example, if your source checkout is /home/fuchsia, but you are current directory is /home you will see this error:

/home $ fx help
Cannot find the Platform Source Tree in a parent of directory: /home

/home $ cd fuchsia
/home/fuchsia $ fx help
usage: fx [--dir BUILD_DIR] [-d DEVICE_NAME] [-i] [-x] COMMAND [...]

Note that if you have your environment set up, you can also use the fd command to quickly jump to the top level directory of the tree no matter where you are (it's loaded as part of fx-env.sh.

For example:

/tmp/some/random/directory $ fd

/home/fuchsia $