microg/GmsCore · error · UnsupportedOperationException
Field $name in ${clazz.fullName} has unsupported type $type.
Error message
Field $name in ${clazz.fullName} has unsupported type $type. What it means
SafeParcelProcessor's FieldInfo throws this when generating parcel-read code for a field whose type it cannot map to a SafeParcelReader call. The processor supports primitives, Parcelable lists/arrays, Binders/IInterface, and Parcelable types with CREATORs; anything else is unsupported at compile time.
Source
Thrown at safe-parcel-processor/src/main/kotlin/org/microg/safeparcel/SafeParcelProcessor.kt:368
"java.util.List<java.lang.Long>", "java.util.ArrayList<java.lang.Long>" -> when {
!useValueParcel -> "$variableName = $SafeParcelReader.readLongList(parcel, header)"
else -> "$variableName = $SafeParcelReader.readList(parcel, header, java.lang.Long.class.getClassLoader())"
}
"java.util.List<java.lang.Float>", "java.util.ArrayList<java.lang.Float>" -> when {
!useValueParcel -> "$variableName = $SafeParcelReader.readFloatList(parcel, header)"
else -> "$variableName = $SafeParcelReader.readList(parcel, header, java.lang.Float.class.getClassLoader())"
}
"java.util.List<java.lang.Double>", "java.util.ArrayList<java.lang.Double>" -> when {
!useValueParcel -> "$variableName = $SafeParcelReader.readDoubleList(parcel, header)"
else -> "$variableName = $SafeParcelReader.readList(parcel, header, java.lang.Double.class.getClassLoader())"
}
else -> when {
isList && isParcelable && !useValueParcel -> "$variableName = $SafeParcelReader.readParcelableList(parcel, header, $listItemType.CREATOR)"
isArray && isParcelable -> "$variableName = $SafeParcelReader.readParcelableArray(parcel, header, $listItemType.CREATOR)"
isList -> "$variableName = $SafeParcelReader.readList(parcel, header, $listItemType.class.getClassLoader())"
isParcelable -> "$variableName = $SafeParcelReader.readParcelable(parcel, header, $type.CREATOR)"
!isList && isIInterface -> "$variableName = $type.Stub.asInterface($SafeParcelReader.readBinder(parcel, header))"
else -> throw UnsupportedOperationException("Field $name in ${clazz.fullName} has unsupported type $type.")
}
}
}
val readVariableFromParcelCase by lazy { "case $id: $readVariableFromParcel; break;" }
val writeVariableToParcel by lazy {
when (type) {
"boolean", "byte", "char", "short", "int", "long", "float", "double",
"java.lang.Boolean", "java.lang.Byte", "java.lang.Char", "java.lang.Short", "java.lang.Integer", "java.lang.Long", "java.lang.Float", "java.lang.Double" ->
"$SafeParcelWriter.write(parcel, $id, $variableName);"
"java.util.List<java.lang.String>", "java.util.ArrayList<java.lang.String>" -> when {
!useValueParcel -> "$SafeParcelWriter.writeStringList(parcel, $id, $variableName, $mayNull);"
else -> "$SafeParcelWriter.write(parcel, $id, $variableName, $mayNull);"
}
"java.util.List<java.lang.Integer>", "java.util.ArrayList<java.lang.Integer>" -> when {
!useValueParcel -> "$SafeParcelWriter.writeIntegerList(parcel, $id, $variableName, $mayNull);"
else -> "$SafeParcelWriter.write(parcel, $id, $variableName, $mayNull);"View on GitHub (pinned to 157c9d86ac)
Solutions
- Change the field type to one SafeParcel supports (primitive, String, Bundle, IBinder, Parcelable with CREATOR, or List/Array of those).
- Make the field's type Parcelable with a static CREATOR and reprocess.
- Exclude/refactor unsupported fields (e.g. convert Map to List<Pair>) or persist them another way.
- Check the processor's supported-type list in SafeParcelProcessor.kt and add a case if you own the code.
Example fix
// before @Field(10) val config: HashMap<String, String> // after @Field(10) val config: List<String>
Defensive patterns
Strategy: validation
Validate before calling
// compile-time guard: field types must be primitives, String, Bundle, IBinder, // or Parcelable with CREATOR (optionally List/Array of those) require(myField is Parcelable || myField is String || myField is Number)
Prevention
- Only use SafeParcel-supported field types
- Make nested types Parcelable with a CREATOR before referencing them in @Field
- Avoid Map/Set/generic fields in parcelable models
- Run the processor build early to catch unsupported fields at compile time
When it happens
Trigger: Declaring a @Field on a type not covered by the mapping — e.g. generic Maps, custom non-Parcelable objects, arrays of arrays, interfaces without Stub, types without a static CREATOR — triggering the `else -> throw` in readVariableFromParcel.
Common situations: Using Map<K,V> or Set fields; forgetting to make a nested class Parcelable; field typed as an abstract class without CREATOR; recently refactored a field to a new type the processor doesn't know.
Understand the failure class
Background: Type mismatch errors: IllegalArgumentException, TypeError and type guards across 150 open-source libraries — this error's family across 150 libraries.
Related errors
- Can't create Creator for class without constructor
- invalid handle
- INTERNAL_ERROR
- invalid handle
- Upgrades not supported
AI-assisted analysis of microg/GmsCore@157c9d86ac (2026-09-06).
Data as JSON: /api/errors/3b899112328cd233.
Report an issue: GitHub.