Open Bug 1997634 Opened 3 months ago Updated 1 month ago

Build fails with JDK 21 due to deprecated source/target version 8 in ExoPlayer module

Categories

(Firefox for Android :: Media, defect)

All
Android
defect

Tracking

()

People

(Reporter: Gela, Unassigned)

References

(Depends on 1 open bug)

Details

Description

Building Firefox for Android fails when using JDK 21 or higher due to compiler warnings being treated as errors. The error originates from the exoplayer2 module, which compiles with sourceCompatibility and targetCompatibility set to 1.8.

> Task :exoplayer2:compileDebugJavaWithJavac FAILED
Java compiler version 21 has deprecated support for compiling with source/target version 8.
warning: [options] source value 8 is obsolete and will be removed in a future release
warning: [options] target value 8 is obsolete and will be removed in a future release
error: warnings found and -Werror specified

Steps to Reproduce

  1. Use JDK 21 (e.g., version 21.0.7).
  2. Build Firefox for Android from the current main
  3. Observe the build failure in the exoplayer2 module.

Workarounds

  1. Downgrading to JDK 17 or 18 resolves the issue.
  2. Commenting out the "-Werror" compiler argument in firefox/build.gradle also bypasses the error.

Notes

  1. The issue is related to ExoPlayer’s use of JDK 8.
  2. We might need to consider upgrading to Media3 or ensuring moz.configure rejects unsupported JDK versions.
  3. Related discussion on Slack
Component: Accounts and Sync → Android Studio and Gradle Integration
Product: Firefox for Android → Firefox Build System

The severity field is not set for this bug.
:polly, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(polly)

ok, looks like we need to upgrade from exoplayer to media 3 to fix this. It would be good to get ahead of this rather than find ourselves scrambling to do it quickly because we are forced to upgrade to JDK 21 for some other reasons (i don't know any of these yet, but it seems likely they will arise)
i've assigned to "Media", hopefully that is the right component

Component: Android Studio and Gradle Integration → Media
Flags: needinfo?(polly)
Product: Firefox Build System → Firefox for Android

The severity field is not set for this bug.
:titouan, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(tthibaud)

Ideally we remove the exoplayer dependency entirely and have Gecko provide it. This is also desired to remove the Java Media process entirely for the Isolated Process work. Bug 2004743

Depends on: 2004743
Flags: needinfo?(tthibaud)
Severity: -- → S3
You need to log in before you can comment on or make changes to this bug.