Different gradle tasks on server for Android project

android
gradle

#1

Hi,
I have a strange problem with Android/Gradle. For some reason different tasks are being picked up by Circle than on my local machine. Here is what I see on CircleCI:

init - Initializes a new Gradle build. [incubating]
wrapper - Generates Gradle wrapper files. [incubating]

buildEnvironment - Displays all buildscript dependencies declared in root project 'jdgroup-android'.
components - Displays the components produced by root project 'jdgroup-android'. [incubating]
dependencies - Displays all dependencies declared in root project 'jdgroup-android'.
dependencyInsight - Displays the insight into a specific dependency in root project 'jdgroup-android'.
dependentComponents - Displays the dependent components of components in root project 'jdgroup-android'. [incubating]
help - Displays a help message.
model - Displays the configuration model of root project 'jdgroup-android'. [incubating]
projects - Displays the sub-projects of root project 'jdgroup-android'.
properties - Displays the properties of root project 'jdgroup-android'.
tasks - Displays the tasks runnable from root project 'jdgroup-android' (some of the displayed tasks may belong to subprojects)

Here is an excerpt of what I see locally:

androidDependencies - Displays the Android dependencies of the project.
signingReport - Displays the signing info for each variant.
sourceSets - Prints out all the source sets defined in this project.
assemble - Assembles all variants of all applications and secondary packages.
assembleAndroidTest - Assembles all the Test applications.

I don’t understand why they are different. I have checked in the gradlew folder, but for some reason it is not picking it up. I have other Android projects that are library projects and these work OK.

Any ideas would be really helpful.

Thanks,

Clive


#2

One thing I can see is there seems to be something different in the gradle depencies section of the CI build.

Here is what I see on my other projects, which is the same thing I see locally:

Starting a Gradle Daemon, 1 incompatible and 3 stopped Daemons could not be reused, use --status for details
The JavaCompile.setDependencyCacheDir() method has been deprecated and is scheduled to be removed in Gradle 4.0.
Incremental java compilation is an incubating feature.
The TaskInputs.source(Object) method has been deprecated and is scheduled to be removed in Gradle 4.0. Please use TaskInputs.file(Object).skipWhenEmpty() instead.
[buildinfo] Not using buildInfo properties file for this build.
:dependencies

------------------------------------------------------------
Root project
------------------------------------------------------------

No configurations

BUILD SUCCESSFUL

Total time: 21.329 secs

Yet on my failing build I see this:

Starting a Gradle Daemon, 1 incompatible and 4 stopped Daemons could not be reused, use --status for details
:dependencies

------------------------------------------------------------
Root project
------------------------------------------------------------

No configurations

BUILD SUCCESSFUL

Total time: 9.103 secs

Its like something is being missed in the gradle setup, but I have no idea what could be causing it.

Clive


#3

I’m not sure what the issue was, but it had something to do with the Android project itself. I created a new project (the original was an old Eclipse style) and then copied everything back and it started working.


#4

Thank you for following up!

Always good to hear when things work out themselves :slight_smile:


#5

No worries, I’m just glad that it worked, I had run out of ideas at that point. The strange thing was, as far as I could see the project structure was correct (https://developer.android.com/studio/build/index.html) and I just copy and pasted the files back. I chalked it off as one of life’s mysteries :slight_smile:


#6