CircleCI Gradle Build Dependency : Failed to apply plugin [id 'com.android.application'] Error at bottom with current version is 4.9 but I'm using required Gradle version 2.10

#!/bin/bash -eo pipefail
gradle dependencies

Welcome to Gradle 4.9!

Here are the highlights of this release:

  • Experimental APIs for creating and configuring tasks lazily
  • Pass arguments to JavaExec via CLI
  • Auxiliary publication dependency support for multi-project builds
  • Improved dependency insight report

For more details see Gradle 4.9 Release Notes

Starting a Gradle Daemon (subsequent builds will be faster)


Configure project :app
Project evaluation failed including an error in afterEvaluate {}. Run with --stacktrace for details of the afterEvaluate {} error.

FAILURE: Build failed with an exception.

  • Where:
    Build file ‘/home/circleci/repo/app/build.gradle’ line: 15

  • What went wrong:
    A problem occurred evaluating project ‘:app’.
    > Failed to apply plugin [id ‘com.android.application’]
    ** > Gradle version 2.10 is required. Current version is 4.9. If using the gradle wrapper, try editing the distributionUrl in /home/circleci/repo/gradle/wrapper/gradle-wrapper.properties to gradle-2.10-all.zip**

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 30s
Exited with code 1

It would add a great deal of readability to apply preformatting formatting to your question. Please do that now:

  • Click the edit button in the post toolbar
  • With your mouse, select the text that is one continuous log
  • Click the </> code button in the editor toolbar

Repeat if you have several blocks of logs/code in a single post.

Thanks for reply, but what’s the need of this?

Are you asking about why it is good to make things readable? :smiley_cat:

Hey,

I’m facing this error

A problem occurred evaluating project ‘:app’.
> Failed to apply plugin [id ‘com.android.application’]
** > Gradle version 2.10 is required. Current version is 4.9. If using the gradle wrapper, try editing the distributionUrl in /home/circleci/repo/gradle/wrapper/gradle-wrapper.properties to gradle-2.10-all.zip**

I see you are getting this error when you execute gradle dependencies. Could you please try ./gradlew dependencies instead and see what happens?

Also, when you run gradlew, you may want to check the distributionUrl in gradle-wrapper.properties.

Thanks Mayu.

distributionUrl is same as suggested (gradle-2.10-all.zip) .

I tried to fix it up to 50 times by config.yml but i don’t know what is ./gradlew and how i can run by it in CircleCI.

Please let me know how can i fix it by ./gradlew?

Thank you so much Mayu! slight_smile:

Can you type “ls” at the top of your Android project? Do you see gradlew?

1 Like
steps:
  - checkout
  - run: ls
  - run: ./gradlew dependencies
1 Like

Getting this error

#!/bin/bash -eo pipefail ./gradlew dependencies

/bin/bash: ./gradlew: Permission denied
Exited with code 126

chmod +x gradlew

Thanks for your support MAYU,

Please have a look in my config.yml

config.yml.pdf (142.2 KB)

Error:
1: I’m getting this when i use circleci/android:api-25-alpha as a docker image
failed to find target with hash string ‘android-24’ in: /opt/android/sdk

2: When i use circleci/openjdk:8-jdk as a docker image, getting this error
SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.

Also find below the version code which is defined in my build.gradle

compileSdkVersion 24
buildToolsVersion “23.0.2”
targetSdkVersion 23

In app dependencies
compile ‘com.android.support:appcompat-v7:24.1.1’

In root dependencies
classpath ‘com.android.tools.build:gradle:2.1.0’

@swatisoni-ewebcore: please learn to use Markdown, it is the standard way of showing formatted text-based content. PDFs are not a good way to do this, as they collapse spaces when using the clipboard.

Your compile version is 24, so I would use circleci/android:api-24-alpha.

I tried to done with 23 but getting same error with hash string ‘andoird-23’

Same error with circleci/android:api-24-alpha?

When I use 25 then error will produce as 24 and when I use 24 then get with 23

Yes Mayu, Plz help

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.