升级到 Kotlin 1.5.20 时问题 whit google 映射

Issue whit google maps when upgrading to Kotlin 1.5.20

我最近从 1.5.0 升级到 gradle 1.5.20,因为我使用 Hilt 我添加了这个 我还使用 Google 地图 Api 以及何时我升级了一个新问题 rise.

Internal Error occurred while analyzing this expression:
java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0
    at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)
    at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70)
    at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:248)
    at java.base/java.util.Objects.checkIndex(Objects.java:372)
    at java.base/java.util.ArrayList.get(ArrayList.java:459)
    at org.jetbrains.kotlin.types.typeUtil.TypeUtilsKt.extractTypeParametersFromUpperBounds(TypeUtils.kt:209)
    at org.jetbrains.kotlin.types.typeUtil.TypeUtilsKt.extractTypeParametersFromUpperBounds(TypeUtils.kt:203)
    at org.jetbrains.kotlin.types.typeUtil.TypeUtilsKt.extractTypeParametersFromUpperBounds(TypeUtils.kt:189)
    at org.jetbrains.kotlin.load.java.lazy.types.JavaTypeResolverKt.getErasedUpperBound(JavaTypeResolver.kt:358)
    at org.jetbrains.kotlin.load.java.lazy.types.JavaTypeResolver$computeArguments$erasedUpperBound.invoke(JavaTypeResolver.kt:234)
    at org.jetbrains.kotlin.load.java.lazy.types.JavaTypeResolver$computeArguments$erasedUpperBound.invoke(JavaTypeResolver.kt:233)
    at org.jetbrains.kotlin.storage.LockBasedStorageManager$LockBasedLazyValue.invoke(LockBasedStorageManager.java:408)
    at org.jetbrains.kotlin.storage.LockBasedStorageManager$LockBasedNotNullLazyValue.invoke(LockBasedStorageManager.java:527)
    at org.jetbrains.kotlin.types.LazyWrappedType.getDelegate(SpecialTypes.kt:82)
    at org.jetbrains.kotlin.types.WrappedType.getConstructor(KotlinType.kt:128)
    at org.jetbrains.kotlin.types.typeUtil.TypeUtilsKt.containsSelfTypeParameter(TypeUtils.kt:231)
    at org.jetbrains.kotlin.types.typeUtil.TypeUtilsKt.containsSelfTypeParameter(TypeUtils.kt:237)
    at org.jetbrains.kotlin.types.typeUtil.TypeUtilsKt.hasTypeParameterRecursiveBounds(TypeUtils.kt:223)
    at org.jetbrains.kotlin.load.java.lazy.types.JavaTypeResolver.computeArguments(JavaTypeResolver.kt:218)
    at org.jetbrains.kotlin.load.java.lazy.types.JavaTypeResolver.computeSimpleJavaClassifierT...

这个问题是指这行代码:

val collection = markerManager.getCollection(layer.id)
        if (collection == null) {
            markerManager.newCollection(layer.id)
                .setOnMarkerClickListener { marker ->
                    navigate(marker.tag as Marker)
                    false
                }
        }

我也遇到了这个问题

我找到了这个问题的官方 Kotlin 票证:https://youtrack.jetbrains.com/issue/KT-47459

1.5.21版本已解决,现已发布