Skip to content

RuntimeException in MessageSchema on Android with Proguard #6463

@MatFl

Description

@MatFl

Version: v3.9.0
Language: Java/Android
Protoc gradle plugin 0.8.10 for java with option "lite"

When running an proguard obfuscated android app a Runtime Exception is thrown when trying to build a Proto with it's Builder.

java.lang.RuntimeException: Field fieldName_ for xxx.yyy.z.b$d not found. Known fields are [private java.lang.String xxx.yyy.z.b$d.h, ...]
        at com.google.e.ck.a(MessageSchema.java:608)
        at com.google.e.ck.a(MessageSchema.java:502)
        at com.google.e.ck.a(MessageSchema.java:221)
        at com.google.e.bz.a(ManifestSchemaFactory.java:85)
        at com.google.e.bz.a(ManifestSchemaFactory.java:71)
        at com.google.e.dc.a(Protobuf.java:93)
        at com.google.e.dc.c(Protobuf.java:107)
        at com.google.e.bh.M(GeneratedMessageLite.java:170)
        at com.google.e.bh$a.ab(GeneratedMessageLite.java:386)
        at com.google.e.bh$a.ac(GeneratedMessageLite.java:394)
        at xxx.yyy.a(XXX)

It seems than since 3.8.0 the new Javalite runtime uses reflection for the Schemas. I thought the lite should NOT be using any reflection at all.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions