Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workflow: App crashes with NoSuchMethodError (getLogger) when calling FhirOperator #1800

Closed
omarismail94 opened this issue Jan 11, 2023 · 2 comments
Assignees
Labels
P2 Medium priority issue

Comments

@omarismail94
Copy link
Contributor

omarismail94 commented Jan 11, 2023

Describe the bug

App crashes with the stack trace below when initialising the FhirOperator:

 java.lang.NoSuchMethodError: No static method getLogger(Ljava/lang/String;)Ljava/lang/System$Logger; in class Ljava/lang/System; or its super classes (declaration of 'java.lang.System' appears in /apex/com.android.art/javalib/core-oj.jar)
                                                                                                    	at com.github.benmanes.caffeine.cache.Caffeine.<clinit>(Caffeine.java:142)
                                                                                                    	at com.github.benmanes.caffeine.cache.Caffeine.newBuilder(Caffeine.java:254)
                                                                                                    	at org.hl7.fhir.r4.hapi.ctx.HapiWorkerContext.<init>(HapiWorkerContext.java:69)
                                                                                                    	at org.hl7.fhir.r4.hapi.fluentpath.FhirPathR4.<init>(FhirPathR4.java:23)
                                                                                                    	at org.hl7.fhir.r4.hapi.ctx.FhirR4.createFhirPathExecutor(FhirR4.java:47)
                                                                                                    	at ca.uhn.fhir.context.FhirContext.newFhirPath(FhirContext.java:822)
                                                                                                    	at org.opencds.cqf.cql.evaluator.fhir.util.FhirPathCache.lambda$cachedForContext$0(FhirPathCache.java:18)
                                                                                                    	at org.opencds.cqf.cql.evaluator.fhir.util.FhirPathCache$$ExternalSyntheticLambda0.apply(Unknown Source:4)
                                                                                                    	at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1710)
                                                                                                    	at org.opencds.cqf.cql.evaluator.fhir.util.FhirPathCache.cachedForContext(FhirPathCache.java:18)
                                                                                                    	at org.opencds.cqf.cql.evaluator.library.CqlFhirParametersConverter.<init>(CqlFhirParametersConverter.java:52)
                                                                                                    	at com.google.android.fhir.workflow.FhirOperator.<init>(FhirOperator.kt:86)

Component
Workflow Library

To Reproduce
Clone my repo:

https://github.com/omarismail94/android-fhir.git

Then checkout the branch: doesNotWorkFlow :

git checkout doesNotWorkflow

Launch the demo app onto a connected device or emulator:

./gradlew :demo:installDebug

the app crashes with the stack trace above.

The app I made is based on the Wiki guide: https://github.com/google/android-fhir/wiki/WFL%3A-Getting-Started

Expected behavior
I expect the app to load. I set the minSDK version to 28, after looking at Issue #1627 but that did not help.

Smartphone (please complete the following information):

  • Device: Pixel 7
@omarismail94
Copy link
Contributor Author

@vitorpamplona If you have a chance, can you look at this and let me know what I am missing? I feel Im missing something simple but I've been banging away at this for a couple of hours and can't find a solution

@omarismail94
Copy link
Contributor Author

Thanks to @aditya-07 , I am able to resolve this issue. I have to add this block to my demo build file:

configurations {
  all {
    removeIncompatibleDependencies()
    forceHapiVersion()
  }
}

I see this block as well in the Workflow lib, why doesn't compiling the Workflow lib as a JAR include the dependencies that result from forceHapiVersion?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 Medium priority issue
Projects
Status: Complete
Development

No branches or pull requests

2 participants