Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

fastlane cannot find gradlew file?

Trying to get fastlane up and running for my Android project. I have the fastfile and appfile in my project directory, but when my lane executes the gradle action it fails with the following error:

Couldn't find gradlew at path '/Users/MyUser/Documents/Project/Android/gradlew'

Meanwhile, if I pull up that directory in Finder - the gradlew file is in fact present.

No clue what my next step should be here.. anyone have any similar problems or suggestions?

like image 413
nserror Avatar asked Dec 20 '16 19:12

nserror


People also ask

Where is the Gradlew file?

The Wrapper shell script and batch file reside in the root directory of a single or multi-project Gradle build. You will need to reference the correct path to those files in case you want to execute the build from a subproject directory e.g. ../../gradlew tasks .

How do I run a Gradlew file?

To run a Gradle command, open a command window on the project folder and enter the Gradle command. Gradle commands look like this: On Windows: gradlew <task1> <task2> … ​ e.g. gradlew clean allTests.


2 Answers

I had the same issue, as I tried to place fastlane in my Project-Dir on same level as /ios and /android.

You can easily solve it by adding the project_dir parameter to your gradle-requests:

gradle(task: "clean assembleRelease", project_dir: 'android/')

like image 105
suther Avatar answered Sep 21 '22 00:09

suther


I was able to resolve this by moving my Fastfile into a fastlane directory. Previously I had the fastlane files in the root of my project, moving them resolved the issue.

like image 42
nserror Avatar answered Sep 18 '22 00:09

nserror