Gradle unit test failed - android

#1

my gradle unit test failed since last week. I try lot of options, but none of them works.

Please help me to fix that issue…

The failed task is

Task :app:testDebugUnitTest

Calling mockable JAR artifact transform to create file: /root/.gradle/caches/transforms-2/files-2.1/175cba0d461719c71a1a77617858f6de/android.jar with input /opt/android-sdk-linux/platforms/android-29/android.jar

…scenes.login.utils.StringValidationUtilsTest > isValidEmailLength FAILED
org.apache.tools.ant.BuildException
Caused by: org.apache.maven.artifact.resolver.ArtifactResolutionException
Caused by: org.apache.maven.artifact.metadata.ArtifactMetadataRetrievalException
Caused by: org.apache.maven.project.ProjectBuildingException
Caused by: org.apache.maven.project.ProjectBuildingException
Caused by: org.apache.maven.artifact.resolver.ArtifactNotFoundException
Caused by: org.apache.maven.wagon.ResourceDoesNotExistException

here is the build

1 Like

#2

WE ARE STILL WAITING FOR RESPONSE :slightly_smiling_face:

0 Likes

#3

The same errors are also happening to us, branches that were working previously stopped working on Friday 3 days ago.

0 Likes

#4

Has a solution for this problem been found?

0 Likes

#5

The same errors are happening to us.

0 Likes

#6

We solved the issue by changing robolectric maven url.

android {
  testOptions {
    unitTests.all {
     systemProperty 'robolectric.dependency.repo.url', 'https://repo1.maven.org/maven2'
    }
  }
}

reference

0 Likes

#7

Hi @mattak. Glad to hear you were able to find a solution.

1 Like

#8

Hi @Gourave @chetan.dobariya @ahinton-league,

Thank you for your patience.

Can you please try @mattak’s solution and follow-up whether or not this resolved the issue for you? If it did not, we can continue investigating from there.

Thanks,
Luna

0 Likes

#9

Hi Luna,

Unfortunately this doesnt solve our issue. Also, we are using Kotlin and Java for development. It seems like the solution is for Flutter.

0 Likes

#11

Hi @Gourave @chetan.dobariya @ahinton-league,

If @mattak’s solution did not work for you, please try to reproduce the Bitrise workflow locally to see if they have any similar failures (more details found here: How to debug your build locally / "It works on my Mac/PC but not on bitrise.io").

In the event that the error occurs on the Dockerized stack but not on the clean build using Bitrise, please let me know so I can pass the issue to our tooling team for reproduction and investigation.

Thanks and looking forward to hearing from you.

Kind regards,
Luna

0 Likes

#12

In my case the problem was from robolectric. After update to the last version everything is OK.

3 Likes

#13

This worked! Thank you so much

1 Like

#14

@IvanVatov Great to hear!

0 Likes

#15

@Gourave Great to hear!

0 Likes

closed #16
0 Likes