Status Update
Comments
pe...@gmail.com <pe...@gmail.com> #2
This is likely due to an incorrect service loader specified somewhere.
If you are unable to fix the server loader spec, you can add a -dontwarn
rule for the class to silence the error using:
-dontwarn com.google.protobuf.java_com_google_android_gmscore_sdk_target_granule__proguard_group_gtm_N1281923064GeneratedExtensionRegistryLite$Loader
A discussion of a similar situation can be found in
pe...@gmail.com <pe...@gmail.com> #3
Could you see which service file the class is declared in? You will need to look for the class referenced META-INF/services/<somefile>
.
Alternatively you can create a
[Deleted User] <[Deleted User]> #4
Unexpected reference to missing service implementation class in META-INF/services/com.google.protobuf.GeneratedExtensionRegistryLoader: com.google.protobuf.java_com_google_android_gmscore_sdk_target_granule__proguard_group_gtm_N1281923064GeneratedExtensionRegistryLite$Loader.
Unexpected reference to missing service class: META-INF/services/com.google.protobuf.GeneratedExtensionRegistryLoader.
Unexpected reference to missing service class: META-INF/services/org.jetbrains.kotlin.compiler.plugin.CommandLineProcessor.
Unexpected reference to missing service class: META-INF/services/org.jetbrains.kotlin.compiler.plugin.ComponentRegistrar.
Unexpected reference to missing service class: META-INF/services/org.jetbrains.kotlin.diagnostics.rendering.DefaultErrorMessages$Extension.
Caused by: [CIRCULAR REFERENCE: com.android.tools.r8.utils.b: Missing class com.google.protobuf.java_com_google_android_gmscore_sdk_target_granule__proguard_group_gtm_N1281923064GeneratedExtensionRegistryLite$Loader (referenced from: java.util.List kotlinx.coroutines.internal.FastServiceLoader.load(java.lang.Class, java.lang.ClassLoader))]
pe...@gmail.com <pe...@gmail.com> #5
The app doesn't work with
-dontwarn com.google.protobuf.java_com_google_android_gmscore_sdk_target_granule__proguard_group_gtm_N1281923064GeneratedExtensionRegistryLite$Loader
la...@gtempaccount.com <la...@gtempaccount.com> #6
You will need a -dontwarn
for each type that is missing.
il...@google.com <il...@google.com>
il...@google.com <il...@google.com>
ap...@google.com <ap...@google.com> #7
But "missing_rules.txt" has only -dontwarn com.google.protobuf.java_com_google_android_gmscore_sdk_target_granule__proguard_group_gtm_N1281923064GeneratedExtensionRegistryLite$Loader
After adding this to pro-guard, app stops working as intended.
jb...@google.com <jb...@google.com> #8
I get the error:
java.lang.ClassCastException: java.lang.Class cannot be cast to java.lang.reflect.ParameterizedType
Description
Version used: 2.2.0-alpha01
LiveData.switchMap breaks the nullability contracts of the corresponding Java Transformations.switchMap.
Transformations.switchMap allows returning null, while the Kotlin extension function does not.
I can write
Transformations.switchMap(fooLiveData) { it?.barLiveData }
but I can't write
fooLiveData.switchMap { it?.barLiveData }
since I'm expected to return a non-nullable LiveData<Y>.
To make it compile, I would need to write an ugly
fooLiveData.switchMap { it?.barLiveData ?: MutableLiveData<Bar>(null) }
The null return value is safely handled in the Java implementation, so I believe there should be no reason to force a non-null return type.
Please consider changing the switchMap function signature from
inline fun <X, Y> LiveData<X>.switchMap(crossinline transform: (X) -> LiveData<Y>): LiveData<Y>
to
inline fun <X, Y> LiveData<X>.switchMap(crossinline transform: (X) -> LiveData<Y>?): LiveData<Y>