Include runtimeOnly dependencies in Android aab


How can i include runtimeOnly dependencies in my android library project (aab) classpath?

I want to use JWT in my android library project, so I declared those dependencies:

dependencies {
    api 'io.jsonwebtoken:jjwt-api:0.11.5'
    runtimeOnly('io.jsonwebtoken:jjwt-orgjson:0.11.5') {
        exclude group: 'org.json', module: 'json' //provided by Android natively

When other app reference to my compiled aar library file, an error “NoClassDefFoundError” is being raised because those dependencies are not in the classpath.