Help with Gradle Build Error: DHIS2 Android Project Dependencies Issue

Hi DHIS2 Community,

I’m currently working on a project that uses the DHIS2 Android app, which was previously handled by someone else. As I’m new to DHIS2 and the DHIS2 Capture app, I’ve run into a Gradle build issue that I’m unable to resolve.

Caused by: org.gradle.api.internal.artifacts.ivyservice.TypedResolveException: Could not resolve all files for configuration ':compose-table:androidJdkImage'.

Additionally, the full error stack includes:

Caused by: org.gradle.api.internal.artifacts.transform.TransformException: Execution failed for JdkImageTransform: C:\Users\HISP-IT\AppData\Local\Android\Sdk\platforms\android-34\core-for-system-modules.jar.
Caused by: org.gradle.api.internal.artifacts.transform.TransformException: Failed to transform core-for-system-modules.jar to match attributes {artifactType=_internal_android_jdk_image, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}.

I’ve tried clearing the Gradle cache, refreshing dependencies, and checking SDK versions, but the issue persists.

If anyone here has encountered a similar issue or can point me in the right direction to resolve this, I’d really appreciate your help. Since this is an urgent project with a tight deadline, any advice would be very valuable.

Thanks in advance!

Best regards,
Mohd Nawaz

Hi @Mohd_Nawaz,

the issue might be related to a the java SDK used to run gradle. Could you verify the java SDK version used by Gradle?

Also, which Android capture app version (commit) are you running?

Hi @vgarciabnz,
I’m using DHIS2 Android Capture App version 2.9 and Java 17 SDK. I’m attaching a screenshot of my Java SDK and Gradle configuration below.

Let me know if you need any other details.


Regards,
Mohd Nawaz

Try using JDK 21 (JetBrains Runtime) and let me know if you see any difference.

Apart from that, I can see that your gradle project name is different to the default one (dhis2-android-capture-app), so maybe there are more changes in the gradle configuration that I can’t figure out and that are causing the issue.

I’m getting the same error while using JDK 21, with no difference in the error. I have tried almost all the available options in Gradle JDK, as you can see in the screenshot.

Please let me know if any other details are required.


Hi @Mohd_Nawaz you could maybe try updating the gradle version? also ensure that compileSdk value is set to 35 just in case

Okay