Unverified Commit f34519d8 authored by Niclas's avatar Niclas Committed by GitHub

fix #973 -- NumberFormatException in JvmTaskConfiguration (#977)

See https://github.com/JetBrains/skiko/issues/973
parent d04654c6
......@@ -543,7 +543,7 @@ fun Project.androidJar(askedVersion: String = ""): Provider<File> =
val platformsDir = androidHome.resolve("platforms")
val versions = platformsDir.list().orEmpty()
versions.maxByOrNull { name -> // possible name: "android-32", "android-33-ext4"
name.split("-").getOrNull(1)?.toInt() ?: 0
name.split("-").getOrNull(1)?.toIntOrNull() ?: 0
} ?: error(
buildString {
appendLine("'$platformsDir' does not contain any directories matching expected 'android-NUMBER' format: ${versions}")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment