Gradle unit test failed - android

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

WE ARE STILL WAITING FOR RESPONSE :slightly_smiling_face:

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

Has a solution for this problem been found?

The same errors are happening to us.

We solved the issue by changing robolectric maven url.

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

reference

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

1 Like

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

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.

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

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

3 Likes

This worked! Thank you so much

1 Like

@IvanVatov Great to hear!

@Gourave Great to hear!