Hi. Trying to upgrade `Timber` to `5.0.1` and get ...
# squarelibraries
d
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
@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
Their attributes are also searching for Java 11 so I doubt it
We can still add it if it's actually missing
d
Should I report this as an issue on github perhaps?
j
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
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
245 Views