Build constantly failing when installing Android dependencies

android

#1

Bitrise Build Issue Report template

Description of the issue

The android builds are constantly failing when running ./gradlew dependencies. Usually for bintray downloads, but there is many occurrences, that fails for many reasons

Environment:

Where did the issue happen?

Bitrise.io stack Android & Docker, Ubuntu 16.04

Which build Step causes the issue and which version of the step?

install-missing-android-tools

Reproducibility

  • Does a “Rebuild” help? (You can trigger a rebuild from the Build’s page, by clicking the “Rebuild” button in the top right corner of a finished build) : NO
  • Does a rebuild without caches help? (You can remove the Cache:Pull and Cache:Push steps temporarily to not to use the cache, or you can delete all the caches on the Settings tab of the app. : NO
  • Does the issue happen sporadically, or every time? : Constantly
  • Does upgrading the build Step to the latest version help? : NO
  • When did the issue start? : It has been an sporadic problem for more than 3 months, but it has being getting worse, and worse in the latest weeks.

Local reproduction

The bug is not reproducible in the local machine!

Local reproduction: Linux / Android (docker based) stack builds

The bug is not reproducible in the local machine!

Build log


Weekly Virtual Machine / Stack updates - 2018.10.13
#2

@viktorbenei As I mentioned, here are other instances of the constant problem:




#3

Hi @FWIgor :wave:

Checked all 4 logs.

It seems there are two separate issues.

a8fc5f126235fa50 & 6aff14ccc04d05aa:

> Could not GET 'https://jcenter.bintray.com/io/fabric/tools/gradle/1.25.4/gradle-1.25.4.pom'.
               > Read timed out

which means jcenter.bintray.com was not available (well, the request timed out) at the time. As we discussed on Twitter https://twitter.com/ViktorBenei/status/1052242906235498496


The other error (in 366904ca11a003bd & 18cb189877ed7035):

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':sample'.
> Failed to notify project evaluation listener.
   > java.lang.reflect.InvocationTargetException (no error message)

Without the code hard to say, but this seems to be an issue in the code somewhere, maybe in build.gradle or similar if you have something more complex in that. Though in the stack trace part of the log I also see: Caused by: org.gradle.api.artifacts.ResolveException: Could not resolve all dependencies for configuration ':sample:debugRuntimeClasspath' so it might be a missing/partial dependency? :thinking: Not sure, I don’t recall seeing this before, but it seems to be coming from the build config (e.g. build.gradle) or similar file. You can see the stack-trace in the log, I guess that helps you more than it helps me (as I’m not familiar with your project/code) :slight_smile:


#4

For the jcenter read timed out issue: please upgrade the install-missing-android-tools step in the build config!

It seems you use 2.0.3, and the current latest version is 2.2.0.

Even more importantly, in 2.0.4 we introduced additional retry logic to try to mitigate these temporary networks issues of the dependency servers (https://github.com/bitrise-steplib/steps-install-missing-android-tools/releases/tag/2.0.4).


#5

@viktorbenei

First:

Using version 2.2.0 it failed with the error:

Retrying...
Failed to ensure android components, error: output: Parallel execution with configuration on demand is an incubating feature.

Which is not the reflect the real issue at the moment of the failure (bintray not being available)

Second:

Regarding the other error (in 366904ca11a003bd & 18cb189877ed7035): After re-triggering the build, it succeeded without changing the code AT ALL! So, I will not believe that this is a bug on code. Specially that it doesn’t happen on other machines. This was caused by the failure on properly downloading the dependency because of the previously failed step. Maybe, because of the same Bintray being unavailable.

So, I’ll have to fork/refactor the Cache:Push/Pull steps, specially because I’ll not be able to fully move away from Bintray for now.


#6

Hi guys,

I’m facing the same problem, failing on ‘install-missing-android-tools’ step.

I’ve already run the code on different machines, and the build has worked fine on all local machines.

The log error is not conclusive:

  • What went wrong:
    A problem occurred configuring project ‘:app’.
    > Failed to notify project evaluation listener.
    > java.lang.reflect.InvocationTargetException (no error message)

  • 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.

I’ve ruin the dependencies locally and everything seems to be working:

$ ./gradlew dependencies --stacktrace --scan
Download https://plugins.gradle.org/m2/com/gradle/build-scan-plugin/1.12.1/build-scan-plugin-1.12.1.pom
Download https://plugins.gradle.org/m2/org/jetbrains/kotlin/kotlin-gradle-plugin/1.2.71/kotlin-gradle-plugin-1.2.71.pom
Download https://plugins.gradle.org/m2/com/gradle/build-scan-plugin/1.12.1/build-scan-plugin-1.12.1.jar

> Configure project :app
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)

> Task :dependencies


Root project

No configurations

A web-based, searchable dependency report is available by adding the --scan option.

BUILD SUCCESSFUL in 1m 14s
1 actionable task: 1 executed

Does someone have any idea how to solve it? It breaks EVERY build. It started happening after we increment the build tools from 3.1.4 to 3.2.1 (I’ve already tried to get back to old version, but with no success)


#7

Hi @rafaeld, could you please include a build URL we could look into?


#8

Hi @bitce
Here is the build URL: https://app.bitrise.io/build/7a761ed371f6593f

thank you


#9

Thanks, we are looking into it, thanks for your patience in the while!


#10

I’m having the same issue: https://app.bitrise.io/build/1189f379bc292c5b


#11

@smklinger @rafaeld could you guys try if you are experiencing the same issue on the step version 2.2.0?


#12

We also have this issue in this project: https://app.bitrise.io/build/7c6e98e6d18c2496
Is there a way to check what exactly fails?
We tried with an empty project where build succeeds and we are trying to bring the build.gradle configuration “close” to the project that is failing trying to find the real issue, but it’s taking some time until we finish the investigation. If you could have any clue in advance it would save us a lot of time


#13

Hello there! Could you check out this solution, maybe it works for you as well: