1
votes

I have a Github repository, which is builded on CircleCI. I get following error:

export TERM="dumb" if [ -e ./gradlew ]; then ./gradlew dependencies;else gradle dependencies;fi bash: line 2: ./gradlew: Permission denied

export TERM="dumb" if [ -e ./gradlew ]; then ./gradlew dependencies;else gradle dependencies;fi returned exit code 126

Action failed: gradle dependencies

I can't get what is this caused by, because I give necessary permissions in circle.yml file.

test:
  override:
    - echo y | android update sdk --no-ui --all --filter tools,platform-tools,build-tools-21.1.2,android-21,extra-google-m2repository,extra-google-google_play_services,extra-android-support
    - chmod 777 gradlew
    - chmod a+x gradlew
    - ANDROID_HOME=/usr/local/android-sdk-linux ./gradlew dependencies
    - ./gradlew testVanillaDebugUnitTest -PdisablePreDex
    - echo "y" | sudo /opt/google-cloud-sdk/bin/gcloud beta test android run --app app/build/outputs/apk/app-vanilla-debug.apk --test app/build/outputs/apk/app-vanilla-debug-androidTest.apk --device-ids Nexus5 --os-version-ids 22 --locales en --orientations portrait
2
Anyway you can link to repository and the Circle CI build?mkobit

2 Answers

1
votes

Looking at you circle.yml (found here), the failure is not from lines #25 or #26, it's line #14.

Please notice that order of execution is

  1. dependencies:pre
  2. dependencies:post
  3. test:override
  4. test:post

So what you need to do is remove lines 23, 24 and add chmod +x gradlew as the first command in dependencies:pre

2
votes
  • run: chmod +x gradlew
  • run: ./gradlew assemble

So, first set permission, then run the command you want