Build fails with JDK 21 due to deprecated source/target version 8 in ExoPlayer module
Categories
(Firefox for Android :: Media, 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
- Use JDK 21 (e.g., version 21.0.7).
- Build Firefox for Android from the current main
- Observe the build failure in the exoplayer2 module.
Workarounds
- Downgrading to JDK 17 or 18 resolves the issue.
- Commenting out the "-Werror" compiler argument in firefox/build.gradle also bypasses the error.
Notes
- The issue is related to ExoPlayer’s use of JDK 8.
- We might need to consider upgrading to Media3 or ensuring moz.configure rejects unsupported JDK versions.
- Related discussion on Slack
Updated•3 months ago
|
Comment 1•2 months ago
|
||
The severity field is not set for this bug.
:polly, could you have a look please?
For more information, please visit BugBot documentation.
Comment 2•2 months ago
|
||
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
Comment 3•2 months ago
|
||
The severity field is not set for this bug.
:titouan, could you have a look please?
For more information, please visit BugBot documentation.
Comment 4•2 months ago
|
||
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
Updated•2 months ago
|
Updated•1 month ago
|
Description
•