I have cloned the sdk-skeleton app from GitHub. While building it, I get the following errors(many of them lint issues).
You can set environment variable LINT_PRINT_STACKTRACE=true to dump a full stacktrace to stdout. [LintError]
/Users/keronei/.gradle/caches/modules-2/files-2.1/org.apache.commons/commons-jexl/2.1.1/6ecc181debade00230aa1e17666c4ea0371beaaa/commons-jexl-2.1.1.jar: Error: Invalid package reference in org.apache.commons:commons-jexl; not included in Android: javax.script. Referenced from org.apache.commons.jexl2.scripting.JexlScriptEngine. [InvalidPackage]
/Users/keronei/.gradle/caches/modules-2/files-2.1/nl.jqno.equalsverifier/equalsverifier/2.1.6/9b4f5b94534108530a4140187cfa26986cd092a8/equalsverifier-2.1.6.jar: Error: Invalid package reference in nl.jqno.equalsverifier:equalsverifier; not included in Android: java.lang.instrument. Referenced from nl.jqno.equalsverifier.internal.lib.bytebuddy.dynamic.ClassFileLocator.AgentBased. [InvalidPackage]
It has two suggestions to ignore this lint issues.
Regardless of the lint issues, I did ran the app but unfortunately I don’t seem to go past the login, carefully observation on the log reveals that the local handling of response is the problem,
2020-06-08 17:06:15.481 16740-16740/com.example.android.androidskeletonapp W/System.err: java.lang.RuntimeException: org.hisp.dhis.android.core.maintenance.AutoValue_D2Error
2020-06-08 17:06:15.482 16740-16740/com.example.android.androidskeletonapp W/System.err: at io.reactivex.internal.util.ExceptionHelper.wrapOrThrow(ExceptionHelper.java:46)
2020-06-08 17:06:15.482 16740-16740/com.example.android.androidskeletonapp W/System.err: at io.reactivex.internal.observers.BlockingMultiObserver.blockingGet(BlockingMultiObserver.java:93)
2020-06-08 17:06:15.482 16740-16740/com.example.android.androidskeletonapp W/System.err: at io.reactivex.Completable.blockingAwait(Completable.java:1227)
2020-06-08 17:06:15.482 16740-16740/com.example.android.androidskeletonapp W/System.err: at org.hisp.dhis.android.core.user.internal.UserAuthenticateCallFactory.loginOnline(UserAuthenticateCallFactory.java:165)
2020-06-08 17:06:15.483 16740-16740/com.example.android.androidskeletonapp W/System.err: at org.hisp.dhis.android.core.user.internal.UserAuthenticateCallFactory.loginInternal(UserAuthenticateCallFactory.java:140)
2020-06-08 17:06:15.483 16740-16740/com.example.android.androidskeletonapp W/System.err: at org.hisp.dhis.android.core.user.internal.UserAuthenticateCallFactory.lambda$logIn$0$UserAuthenticateCallFactory(UserAuthenticateCallFactory.java:121)
After this, when I restart the app, it crashes with a stack trace that user credentials were not found
'java.lang.String org.hisp.dhis.android.core.user.User.displayName()' on a null object reference
at com.example.android.androidskeletonapp.ui.main.MainActivity.onCreate(MainActivity.java:72)
It seems to me that after successful authentication, the flag for isLoggedIn is saved as true but the credentials are not, which results to bypassing the login page but cannot load the main activity because there are no credentials.
The stack that is printed after providing correct credentials and returning login failed includes one D2Error.java file, In this file, some entries are not recognised.
*return AutoValue_D2Error.createFromCursor(cursor);*
AutoValue_D2Error is not recognised and is in red, In some way, I thought this could be the culprit because it is involved in the process of persisting user credentials.
I didn’t want to manipulate this configuration further, it could be possible that I have missed something small.
I have done git clone repo-link, git clone --recurse-submodules https://github.com/dhis2/dhis2-android-skeleton-app.git, have also upgraded the sdk to 1.1.1, I have also cloned the sdk separately and included in a different project but I seem to be stuck still.
regards.