Media3 1.7.1 Extension works in APK but fails in Companion (Guava buildOrThrow issue?)

Hello Kodular Team,

I am developing a custom Kodular extension based on AndroidX Media3 (version 1.7.1) for IPTV/HLS playback.

After a long debugging process, I have reached an interesting point and would like to know whether this is a known Companion limitation or if there is a recommended workaround.

Current Status

My extension successfully builds and works inside a compiled APK.

The following code executes successfully:

ExoPlayer player = new ExoPlayer.Builder(context).build();

The extension returns “EXO OK” and does not crash.

Libraries Included

  • media3-common 1.7.1
  • media3-exoplayer 1.7.1
  • media3-decoder 1.7.1
  • media3-extractor 1.7.1
  • media3-datasource 1.7.1
  • guava-33.2.1-android

Problem

The exact same extension fails when loaded through Makeroid Companion.

Runtime error:

java.lang.NoClassDefFoundError / NoSuchMethodError

ImmutableMap.Builder.buildOrThrow()

Investigation Performed

To understand the issue, I extracted the Companion APK from an Android emulator and inspected its dex files.

I found:

com/google/common/collect/ImmutableMap$Builder

exists inside Companion.

However:

buildOrThrow

does NOT exist anywhere in the Companion dex files.

This suggests that Companion bundles an older Guava version, while Media3 1.7.1 expects a newer Guava implementation that includes:

ImmutableMap.Builder.buildOrThrow()

Question

  1. Is Companion known to bundle an older Guava version?
  2. Is there a documented limitation when using newer AndroidX Media3 libraries inside Companion?
  3. Has anyone successfully used Media3 1.7.x in a Kodular extension while still maintaining Companion compatibility?
  4. Is there a recommended way to isolate or relocate Guava dependencies for custom extensions?

Additional Notes

  • APK build works correctly.
  • Only Companion fails.
  • The issue appears to be a dependency conflict rather than a Media3 API problem.
  • I have already confirmed that all required Media3 dependencies are present.

Any advice from the Kodular team or developers who have worked with modern AndroidX / Media3 libraries would be greatly appreciated.

Thank you.

Use proguard and obfuscate classes.
Also don’t worry much about companion.

1 Like

Are you planning to release the plugin?