Closed Bug 1543487 Opened 6 years ago Closed 6 years ago

The generated enums used for events are removed by ProGuard and thus can't be used in introspection

Categories

(Toolkit :: Telemetry, defect, P3)

defect

Tracking

()

RESOLVED FIXED

People

(Reporter: mdroettboom, Assigned: mdroettboom)

Details

(Whiteboard: [telemetry:mobilesdk:m7])

Attachments

(2 files)

Fenix had breakage because the generated enums used by events were being removed from the app's apk by the proguard optimizer, and thus the introspection that is used in EventMetricType failed.

This PR to Fenix "fixed" the issue:

https://github.com/mozilla-mobile/fenix/pull/1521

At a minimum, we should document this proguard run requirement in glean's README.

It may also be possible to fix this at our end -- possibly by making sure those enums are "used" somewhere in the generated code (though possibly at the price of some additional build size).

Assignee: nobody → mdroettboom
Whiteboard: [telemetry:mobilesdk:m?] → [telemetry:mobilesdk:m7]

(In reply to Michael Droettboom [:mdroettboom] from comment #0)

At a minimum, we should document this proguard run requirement in glean's README.

It may also be possible to fix this at our end -- possibly by making sure those enums are "used" somewhere in the generated code (though possibly at the price of some additional build size).

Good catch, this is interesting. So that's what ProGuard is for :D

I agree, at the very least we should document this in our README. I wonder if we could find a way to fix this on our end, though:

  • maybe there's some annotation we could add in our generated code to prevent this?
  • maybe we could change our implementation to work without reflection (if it's possible)?

(In reply to Alessio Placitelli [:Dexter] from comment #1)

I agree, at the very least we should document this in our README. I wonder if we could find a way to fix this on our end, though:

  • maybe there's some annotation we could add in our generated code to prevent this?
  • maybe we could change our implementation to work without reflection (if it's possible)?

Additionally:

  • look if there's some way for us to export our own set of proguard rules, if the above fail.

:Dexter -- I agree these are all good ideas. I'm filing a PR just to add documentation for now. That can buy us time to investigate the other, better alternatives.

Priority: -- → P3
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: