https://kotlinlang.org logo
#squarelibraries
Title
# squarelibraries
d

dimsuz

08/19/2021, 10:17 AM
Hi. Trying to upgrade
Timber
to
5.0.1
and get this error:
Copy code
No matching variant of com.jakewharton.timber:timber:5.0.1 was found. The consumer was configured to find an API of a library compatible with Java 11, preferably in the form of class files, preferably optimized for standard JVMs, and its dependencies declared externally, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm' but:
          - Variant 'releaseApiPublication' capability com.jakewharton.timber:timber:5.0.1 declares an API of a library, and its dependencies declared externally:
              - Incompatible because this component declares a component, with the library elements 'aar' and the consumer needed a component, preferably in the form of class files
Indeed, it's being declared as a dependency in a kotlin-plugin module (no android), but the thing is that timber
4.x
was
aar
too. I'm curious what has changed?
e

eygraber

08/19/2021, 11:27 AM
@jw is this because AGP 7 defaults to Java 11 and
timber/build.gradle
is missing:
Copy code
sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
j

jw

08/19/2021, 11:38 AM
Their attributes are also searching for Java 11 so I doubt it
We can still add it if it's actually missing
d

dimsuz

08/19/2021, 3:22 PM
Should I report this as an issue on github perhaps?
j

jw

08/19/2021, 3:26 PM
Non-Android projects are not supported and I'm not sure how you were using it before
You can follow https://github.com/JakeWharton/timber/issues/338 for platform support beyond Android
d

dimsuz

08/19/2021, 3:34 PM
We had it like this
Copy code
// in buildSrc
object Deps {
   const val timber = "com.jakewharton.....:4.7.1"
   val coreLibs = arrayOf(rxJava, timber, etc)
}

// and then we had a "core" module which was kotlin only and it was a dependecy for all our android modules. This "core" module had:

apply plugin: "kotlin" // no com.android.library
dependencies {
  api Deps.coreLibs
}
Somehow this worked for "older" timber. For now I simply removed timber from "core" libs and import it directly in a few other "top" android-based modules
1
218 Views