Search code examples
androidunity-game-enginegradleapk

Building Gradle project exported from Unity3D project: gradlew not found


I am completely new to the Android build process and Gradle.

I have successfully exported a Gradle project from Unity3D in command line and got the following files in my output folder:

build.gradle        gradle.properties   launcher        local.properties    settings.gradle     unityLibrary

Now the next step is to turn this Gradle project into the apk file, from command line.

I have installed Android Studio on my MacOS machine, completed the first-run setup, and looked at the documentation to build from command line here (https://developer.android.com/studio/build/building-cmdline ). However ./gradlew build.gradle gives zsh: no such file or directory: ./gradlew (all files in the folder are listed above and gradlew is not present) and which gradlew gives gradlew not found error.

I am stuck at this point and don't know what to do to get gradlew command working.

The reason I want to build everything from command line is that I have to automate the whole process in Jenkins.


Solution

  • This installs the required gradle cli

    brew install gradle

    The below creates gradlew file in your project.

    gradle wrapper