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:
Switched Java version as recommended in older discussions.
Downloaded the securestoragelibrary-release.aar file and placed it in the libs/ folder.
Added the following to both root and module-level build.gradle:
groovy
CopyEdit
flatDir {
dirs 'libs'
}
Removed jcenter() and used Maven Central and JitPack.
Ensured the libs/ folder is inside the root of the project (next to app, commons, etc.)
Synced Gradle and cleaned the project multiple times.
Result: Still getting the same error, and the build fails at the commons:dataBindingMergeDependencyArtifactsDebug task.
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
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.
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?
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.
However, I’m now facing a new error while trying to build the app. The error is:
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.
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:
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 @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.
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.