0

Having a android library which has some transitive dependencies.

    api 'com.squareup.retrofit2:retrofit:2.9.0'
    api 'com.squareup.retrofit2:converter-gson:2.9.0'
    api "com.squareup.okhttp3:okhttp:4.10.0"

and with

    id 'maven-publish'

and
    repositories {
        mavenLocal()
        google()
        mavenCentral()
    }

it can do publishToLocalMaven. but when using this library in app, the app crashes with

NoClassDefFoundError: Failed resolution of: Lretrofit2/Retrofit$Builder

It has to add those dependencies directly in the app (which it is supposed to get from the library's api transitive dependencies).

Why the transitive api dependency is missing in the app that uses this library?

lannyf
  • 9,865
  • 12
  • 70
  • 152

0 Answers0