java.lang.ClassNotFoundException: Didn't find class "javax.ws.rs.core.GenericType" on path: DexPathList

354 Views Asked by At

I just integrated an SDK (Ory Java client) into my Android app, but when actually making a request using that SDK, I get this runtime error:

java.lang.NoClassDefFoundError: Failed resolution of: Ljavax/ws/rs/core/GenericType;
    at sh.ory.model.UiNodeAttributes.validateJsonObject(UiNodeAttributes.java:380)
[..]   
Caused by: java.lang.ClassNotFoundException: Didn't find class "javax.ws.rs.core.GenericType" on path: DexPathList[[<paths removed for better readability>]]
    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:259)
[..]

How can I fix that? Could I somehow add the library containing javax.ws.rs.core.GenericType? Is that possible at all as it seems to be part of the Oracle JDK?

1

There are 1 best solutions below

2
On

I was able to use the SDK (Ory Java Client) by generating it myself using openapi-generator version 7.0.1.

Steps:

    -  openapi-generator-cli version-manager set 6.2.1
    +  openapi-generator-cli version-manager set 7.0.1
  • Build client following the steps in README.md