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

android
gradle

#1

I am attempting to setup my build for the first time, and running into challenges. No matter what I attempt, I can’t seem to find Gradle and am getting this error:

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

I have confirmed that I checked in my Gradle wrapper and other config files into my project in GitHub.

I am really at a loss for how to get this to work. Here is my simple circle.yml file:

general:
    artifacts:
        - /home/ubuntu/android-historian/app/build/outputs/apk/

   machine:
  environment:
PATH: "~/$CIRCLE_PROJECT_REPONAME/gradle-2.10/bin:$PATH"
TERM: "dumb"
ADB_INSTALL_TIMEOUT: "10"
GRADLE_OPTS: '-Dorg.gradle.jvmargs="-Xmx2048m -XX:+HeapDumpOnOutOfMemoryError"'

dependencies:
  pre:
- wget "https://services.gradle.org/distributions/gradle-2.10-bin.zip"; unzip gradle-2.10-bin.zip
- echo y | android update sdk --no-ui --all --filter tool,extra-android-m2repository,extra-android-support,extra-google-google_play_services,extra-google-m2repository,android-23
- echo y | android update sdk --no-ui --all --filter build-tools-23.0.2

test:
  override:
    - ./gradlew assembleRelease
    - cp -r android-historian/build/outputs $CIRCLE_ARTIFACTS

#2

Hi there,

Sorry for the slow reply on this. It looks like other people have hit a similar issue: Android Challenges and circle.yml file and there are some potential solutions in that thread.


#3

Yeah I saw that message before I created my query. Unfortunately, that discussion ends without an answer (the last comment says they found there answer, and they link to the Gradle website).

I did research this, and am pretty sure that I DO want to check in my gradle wrapper, and properties, etc - and I have done that.

Will try further tomorrow I guess


#4