androidstarters / kotlin-android-starter

[Kotlin Android] Kotlin Android starter based MVP/Dagger2/RxJava2/Robolectric/Espresso/Mockito. It provides a generator to fast create a Kotlin Android project.
602 stars 97 forks source link

gradlew not working on Windows #30

Closed zxcfer closed 5 years ago

zxcfer commented 6 years ago

When I execute:

gradlew app:assembleDebug

I get:

Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain

Java Version:

java version "1.8.0_171"
Java(TM) SE Runtime Environment (build 1.8.0_171-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.171-b11, mixed mode)

gradle --version

------------------------------------------------------------
Gradle 4.7
------------------------------------------------------------

Build time:   2018-04-18 09:09:12 UTC
Revision:     b9a962bf70638332300e7f810689cb2febbd4a6c

Groovy:       2.4.12
Ant:          Apache Ant(TM) version 1.9.9 compiled on February 2 2017
JVM:          1.8.0_171 (Oracle Corporation 25.171-b11)
OS:           Windows 7 6.1 amd64
michalciolek commented 5 years ago

On the macOS the same.

To fix run:

gradle wrapper

before:

gradlew app:assembleDebug

NOTE: Gradle must be installed on the system, eg. for macOS brew install gradle https://gradle.org/install/