❗️Error Building DHIS2 Android Capture App (Tag 2.7) — Need Help Resolving securestoragelibrary & Other Dependency Issues

Hi DHIS2 Android team and community,

I’m trying to build the DHIS2 Android Capture App v2.7 because our organization has an existing project that was developed using this version.

However, I’m facing a build failure with the following error:
Caused by: org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException:
Could not resolve all files for configuration ‘:commons:debugCompileClasspath’.

Could not find :securestoragelibrary-release:.

What I’ve Tried:

  • :white_check_mark: Switched Java version as recommended in older discussions.
  • :white_check_mark: Downloaded the securestoragelibrary-release.aar file and placed it in the libs/ folder.
  • :white_check_mark: Added the following to both root and module-level build.gradle:

groovy

CopyEdit

flatDir {
    dirs 'libs'
}
  • :white_check_mark: Removed jcenter() and used Maven Central and JitPack.
  • :white_check_mark: Ensured the libs/ folder is inside the root of the project (next to app, commons, etc.)
  • :white_check_mark: Synced Gradle and cleaned the project multiple times.

:warning: Result: Still getting the same error, and the build fails at the commons:dataBindingMergeDependencyArtifactsDebug task.


:folded_hands: Request for Help

Can anyone from the DHIS2 team or community please guide me on how to resolve this dependency issue in v2.7? I’m open to downgrading Gradle or plugins if needed. Any working solution or workaround would be greatly appreciated!

Thanks in advance :raising_hands:

Would you like me to post this on the DHIS2 Community forum for you, or would you prefer to post it yourself? I’m attaching the SS below.

Hi @Mohd_Nawaz

May I understand why you are trying to build the app? Are you making changes to the app itself before building it? If you are making changes, would you like to share more?

If you want to use the Android Capture app version 2.7 you could download it directly from the Github repository: Release Android Capture App for DHIS 2 (v2.7) · dhis2/dhis2-android-capture-app · GitHub

Thanks!

Hi @dhis2-android,

I had previously faced an issue while building the DHIS2 Android SDK, specifically with resolving dependencies under :commons:debugCompileClasspath. That issue has now been resolved it turned out there was a problem while cloning the SDK repository. A fresh clone fixed that. :white_check_mark:

However, I’m now facing a new error while trying to build the app. The error is:

:magnifying_glass_tilted_left: Error Details:
When building the project, I’m getting the following error:

Caused by: org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all files for configuration ':commons:debugCompileClasspath'.

  • Gradle version: 7.0.2
  • Java version: 11
  • AGP version: Compatible with Gradle 7.0.2
    Despite trying a clean build and ensuring a stable internet connection, the error persists. If any dependency needs to be updated or changed in the project to make the build successful, could someone please guide me on exactly what to modify?

Any help or suggestions would be greatly appreciated. :folded_hands:

Thanks in advance!

Thanks for the info and the screenshot.

I’d wait for the @dhis2-android team to get a more solid response on this one. However, I did a quick search and I’m wondering what is the setting for org.gradle.java.home in your gradle.properties? Make sure it’s pointing to the same Java version.

Another thing you could try for debugging is run ./gradlew --debug build

Hi @Mohd_Nawaz,
I’ve checkout the branch to the tag 2.7.1.1 and try to make it work, I used JAVA 17 and compile, I think the errors are related to the dependencies we had in jCenter:

Have you being able to fix all of them?

Hi @andresmr,
I tried to replace jcenter() with maven { url ‘https://jitpack.io’ } but it didn’t work then I tried then I tried to update the dependencies in app/build.gradle like this way:
// ZXing: Works with API 19+
implementation ‘com.journeyapps:zxing-android-embedded:3.3.0’

//  SecureStorageLibrary: Use a JitPack version (we’ll set this up in next step)
implementation 'com.github.adorsys:secure-storage-android:1.2.2'

But from that approach issue still persist. Please tell your approach how can I resolve this error.
Thanks

Hi @andresmr
Any update how can I resolve this issue.
Thanks

Hi @Mohd_Nawaz ,
I didn’t go further to make it work, I have created a branch from the tag 2.7.1.1 and removed secure storage library which we are no longer used, then I installed java 11 in my machine to compile but still having an error.

I think you will need to replace all libraries in jCenter. Let me know if you can try in this branch to find some advance in the issue solving. We will try to look at it deeper if not when we have time.

Hi @andresmr,

Thanks for the update. I’ve already checked out the branch from tag 2.7.1.1 and tested it using both Java 11 and Java 17, but the build still isn’t working. I’ve removed the secure-storage library, replaced jcenter() with mavenCentral(), and also updated some dependencies that were previously hosted on JCenter.

Despite these changes, the build issue still persists. I’ll continue looking into it and trying different approaches.

If you’re able to build the app successfully on your end, please ping me and share the steps you followed that would be a big help.

Thanks!
Best regards,
Mohd Nawaz

1 Like