Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't find referenced class com.google.android.exoplayer2.text.ssa.SsaStyle$SsaAlignment on release #6771

Closed
leemoxx opened this issue Dec 17, 2019 · 5 comments
Assignees
Labels

Comments

@leemoxx
Copy link

leemoxx commented Dec 17, 2019

[REQUIRED] Issue description

I cannot generate signed apk/bundle. Whenever I do it, I get the following messages on failure:

com.google.android.exoplayer2.text.ssa.SsaDecoder: can't find referenced class com.google.android.exoplayer2.text.ssa.SsaStyle$SsaAlignment

com.google.android.exoplayer2.text.ssa.SsaStyle$Overrides: can't find referenced class com.google.android.exoplayer2.text.ssa.SsaStyle$SsaAlignment

[REQUIRED] Reproduction steps

Attempt to generate a signed apk/bundle. I am using ProGuard.

[REQUIRED] Link to test content

[REQUIRED] A full bug report captured from the device

[REQUIRED] Version of ExoPlayer being used

Latest (v2.11.0).

[REQUIRED] Device(s) and version(s) of Android being used

@icbaker
Copy link
Collaborator

icbaker commented Dec 17, 2019

I'm not able to reproduce this building a release/proguarded APK of the demo app at 2.11.

Can you provide more detailed repro instructions, including information about how you're depending on the ExoPlayer library?

@leemoxx
Copy link
Author

leemoxx commented Dec 17, 2019

Hello @icbaker and thanks for the help. I am upgrading from 2.10.4 -> 2.11.0. I did not have any issues creating signed APKs before, so those messages are new to me. I am only adding the ui and core to my project:

implementation 'com.google.android.exoplayer:exoplayer-core:2.11.0'
implementation 'com.google.android.exoplayer:exoplayer-ui:2.11.0'

I have just tried enabling R8 instead of ProGuard, and I was able to create a signed APK without issues. Though, I favor ProGuard because it handles one aspect better. Note that I am only playing offline files on my app.

Does the demo app use R8 or ProGuard?

@icbaker
Copy link
Collaborator

icbaker commented Dec 17, 2019

Thanks for the details - I'm able to reproduce by setting android.enableR8=false in gradle.properties and switching the demo app to pull the dependency in from jcenter instead of local sources.

I actually see 4 warnings - the 2 you've mentioned here & 2 javax-related ones:

Warning: com.google.android.exoplayer2.text.ssa.SsaDecoder: can't find referenced class com.google.android.exoplayer2.text.ssa.SsaStyle$SsaAlignment
Warning: com.google.android.exoplayer2.text.ssa.SsaStyle$Overrides: can't find referenced class com.google.android.exoplayer2.text.ssa.SsaStyle$SsaAlignment
Warning: com.google.android.exoplayer2.util.NonNullApi: can't find referenced class javax.annotation.Nonnull
Warning: com.google.android.exoplayer2.util.NonNullApi: can't find referenced class javax.annotation.meta.TypeQualifierDefault

The javax ones should be suppressed in the same way we suppress the other compile-time annotation classes:

# Don't warn about checkerframework and Kotlin annotations

I'll send a change to add -dontwarn javax.annotation.** there.

It's less obvious we want to be suppressing the SsaAlignment warning - I suspect this is related to having IntDef values inside the IntDef interface - though it's a little strange this:

a) Doesn't affect @HlsMetadataType which follows the same pattern.
b) Only affects ProGuard and not R8.

We're going to look into this in a bit more detail.

In the short term, you should be able to get your app building again by adding both these suppressions to your own proguard-rules.txt:

-dontwarn javax.annotation.**
-dontwarn com.google.android.exoplayer2.text.ssa.SsaStyle$SsaAlignment

@leemoxx
Copy link
Author

leemoxx commented Dec 18, 2019

Thank you so much for the solution and explanation @icbaker I have tried keeping the class originally but that did not help. I have thought about suppressing the warning, but I was afraid it would cause issues. I am not sure if I should be closing this issue or not, so I will leave that to you.

@icbaker
Copy link
Collaborator

icbaker commented Dec 18, 2019

I'll keep this open for now to track removing IntDef values that are defined inside their interfaces.

@icbaker icbaker reopened this Dec 18, 2019
ojw28 pushed a commit that referenced this issue Dec 18, 2019
This seems to work with R8 but interact badly with ProGuard.

issue:#6771
PiperOrigin-RevId: 286215262
@ojw28 ojw28 closed this as completed Dec 18, 2019
ojw28 pushed a commit that referenced this issue Dec 19, 2019
This seems to work with R8 but interact badly with ProGuard.

issue:#6771
PiperOrigin-RevId: 286215262
@google google locked and limited conversation to collaborators Feb 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants