Issue running the app

Hi,

I am having an issue when I try to run the app. This is what I get when I build the project:

And this when I try to run:

I saw someone posted a similar issue few days ago. I tried the suggestion given by @Pablo on that topic, but that did not help me. I am still getting the same error.

I have also tried all the usual things we always try: clean/rebuild, restart etc.

Also:
I am wondering if the wiki-pages are up-to-date? (the commenting/un-commenting)
https://github.com/dhis2/dhis2-android-capture-app/wiki/Cloning .

Hope to get some help here :slight_smile:

Regards,
Gagan

1 Like

Hi @gagandek,

This post should be at Development/SDK- Android Development. Don’t know if it can be moved…
Can you tell me the branch are you trying to build the project? Is it master?

From the images, i would say the problem is the rule engine library. Make sure that your app build.gradle is using the correct rule engine dependency:

"org.hisp.dhis.rules:rule-engine:${libraries.ruleEngine}"

And also check the ruleEngine version in the dependencies.gradle file is 1.0.5.1-SNAPSHOT.

1 Like

Alright, I moved it to this to the correct one. @Pablo

The dependency you mentioned was commented out. So when I un-comment it, I get another error now.:

I think I am on 2.0.0_beta. I think so… :stuck_out_tongue:
versjon

And yes, I have the version you mentioned.
Moreover, I tried to comment/uncomment as the wiki-pages saya. And then something else that my fellow students suggested me to. Currently I have something like this in the build.gradle file:

1 Like

Ok, i think you are not in the latest 2.0.0_beta branch, that build.gradle file has changed a little bit. You should update the project with last changes in the main DHIS2 repository.
But if you are using like that the build.gradle, you are trying to build the project with duplicated dependencies for the rule engine.

Using the 2.0.0_beta branch.
Uncomment implementiation project(':core')
Comment implementiation project(':dhis2-rule-engine') and implementation("org.hisp.dhis:android-core${libraries.dhis2sdk}"){...}

This way you should also check that you are in using the develop branch for the sdk.

Try this but I think you have to update the whole project. Did you fork it or just cloned it? Let me see what remotes do you have. You can can find them here:

Under dhi2-android-capture-app you should have this remote:
git@github.com:dhis2/dhis2-android-capture-app.git
or
https://github.com/dhis2/dhis2-android-capture-app.git

If so, in the VCS tab (check previous image). Click in Update Project. That will update everything.

1 Like

Hi again @Pablo

I have updated the project yesterday. I did it again now, but it still did not seem to work. The gradle file for app looks like this now:

The remotes you asked for:
remotes

And the braches:
branches

However, I am still getting an error:

Gosh, am stuck! :grimacing: :weary:

Br,
Gagan

1 Like

Don’t worry, we are almost there.

I’m sure you are not in the correct 2.0.0_beta branch, cause this is the build.gradle we have right now in that branch:

Make sure to check out the 2.0.0_beta branch from the dhis2-app remote. You can also try to do a pull from that branch.

2 Likes

Hurray!
hurray

Thanks for the help :innocent:

2 Likes