# Chmod: cannot access './gradlew': No such file or directory

**URL:** <https://discuss.circleci.com/t/chmod-cannot-access-gradlew-no-such-file-or-directory/32393>\
**Category:** Build Environment\
**Created:** [September 12, 2019, 1:46pm UTC](https://discuss.circleci.com/t/chmod-cannot-access-gradlew-no-such-file-or-directory/32393 "2019-09-12T13:46:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sudhakar](https://avatars.discourse-cdn.com/v4/letter/s/f05b48/32.png) [@Sudhakar](https://discuss.circleci.com/u/Sudhakar)\
**Post date:** [September 12, 2019, 1:46pm UTC](https://discuss.circleci.com/t/chmod-cannot-access-gradlew-no-such-file-or-directory/32393/1 "2019-09-12T13:46:52Z")

</div>

Hi this is my config.yml for my Android project

# Java Gradle CircleCI 2.0 configuration file

# 

# Check [https://circleci.com/docs/2.0/language-java/](https://circleci.com/docs/2.0/language-java/) for more details

# 

version: 2  
jobs:  
build:  
docker:  
# specify the version you desire here  
- image: circleci/android:api-28-alpha

```
  # Specify service dependencies here if necessary
  # CircleCI maintains a library of pre-built images
  # documented at https://circleci.com/docs/2.0/circleci-images/
  # - image: circleci/postgres:9.4

working_directory: ~/code

environment:
  # Customize the JVM maximum heap limit
  JVM_OPTS: -Xmx3200m
  TERM: dumb

steps:
  - checkout

  # Download and cache dependencies
  - restore_cache:
      key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}

  - run:
      name: Chmod permissions #if permission for Gradlew Dependencies fail, use this.
      command: sudo chmod +x ./gradlew
  - run:
      name: Download Dependencies
      command: ./gradlew androidDependencies

  - save_cache:
      paths:
        - ~/.gradle
      key: v1-dependencies-{{ checksum "build.gradle" }}

```

and for this script i’am getting  
chmod: cannot access ‘./gradlew’: No such file or directory  
can anyone please help me

---

<div class="post-metadata">

**Author:** ![owenjoliver](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/owenjoliver/32/28293_2.png) [@owenjoliver](https://discuss.circleci.com/u/owenjoliver)\
**Post date:** [August 15, 2022, 2:29pm UTC](https://discuss.circleci.com/t/chmod-cannot-access-gradlew-no-such-file-or-directory/32393/2 "2022-08-15T14:29:58Z")

</div>

Hello

I am following up on old tickets in case people are running into the same issue.

The reason for this issue is due to the line: `working_directory: ~/code`

By default on CircleCI, you are in the `~/` folder but when you run the special checkout step using: `- checkout` it will do a git clone into a directory called `project`.

Because of this when you run `./gradlew` it will fail as the `gradlew` file will be located under `~/project`

The resolution for this is to either set `./gradlew` to `~/project/gradlew` or set `working_directory: ~/project`. If you are changing to the full path please be aware this may need to be changed for other files such as `.gradle` from the example given above.

Kind Regards  
Owen Oliver
