Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Travis CI Android build keep failing with gradlew no such file

my travis ci build keeps failing with,

$ chmod +x /.gradlew chmod: cannot access ‘/.gradlew’: No such file or directory The command "chmod +x /.gradlew" failed and exited with 1 during .

I tried all the suggestions, different yml files but cant get rid of this error.

My travis yml is on root directory, the here is my folder structure

root: /src .gitignore .travis.yml

src: /client /server

client: /app /gradle/wrapper build.gradle gradle.properties gradlew gradlew.bat settings.gradle

Here is my travis.yml

sudo: false
language: android
jdk:
  - oraclejdk8
android:
  components:
    - tools
    - platform-tools
    - tools

    # The BuildTools version used by your project
    - build-tools-25.0.3

    # The SDK version used to compile your project
    - android-25
    - extra-google-google_play_services
    - extra-google-m2repository
    - extra-android-m2repository
    - addon-google_apis-google-19

before_install:
  - chmod +x /.gradlew
script:
- "/.gradlew clean build"
notifications:
  email: false

and here is my build.gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.3'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
        maven { url "https://maven.google.com" }
    }
}
task wrapper(type: Wrapper) {
    gradleVersion = '2.3.3'
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

Any suggestions? Thanks

like image 315
John Fraks Avatar asked Nov 19 '25 12:11

John Fraks


1 Answers

To debug this you could change the before_install section to print current directory and list its contents.

before_install:
  - pwd
  - ls -la
  - chmod +x /.gradlew
like image 114
renefritze Avatar answered Nov 21 '25 00:11

renefritze



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!