Java.Lang.NoClassDefFoundError com.google.android.exoplayer2.source.ConcatenatingMediaSource

Kim Strasser 1,321 Reputation points
2023-03-06T09:51:29.5066667+00:00

I use Xamarin MediaManager version 1.2.2 to play songs in my Android and iOS applications: https://github.com/Baseflow/XamarinMediaManager

But the problem is that it is not working in every Android project. For example, it works in a new empty Android project and in another Android project I get the exception. But I used the same template to create both Android projects. I don't know why the same code is not working in every Android project. I have already tried to delete the bin and obj folders but it didn't helped.

I get this exception in the following line of code. This line is executed before I want to play a song.

CrossMediaManager.Current.RepeatMode = MediaManager.Playback.RepeatMode.Off;

Java.Lang.NoClassDefFoundError com.google.android.exoplayer2.source.ConcatenatingMediaSource

Bildschirm­foto 2023-03-04 um 10.54.44

I use target Android version 33 and minimum Android version 31:

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>net7.0-android33.0</TargetFramework>
    <SupportedOSPlatformVersion>31.0</SupportedOSPlatformVersion>
    <OutputType>Exe</OutputType>
    <UseMaui>true</UseMaui>
    <UseMauiEssentials>true</UseMauiEssentials>
...

Why am I getting the exception in one Android project and not in the other?

Developer technologies .NET .NET MAUI
Developer technologies C#
0 comments No comments
{count} votes

Accepted answer
  1. Anonymous
    2023-03-07T03:16:47.3433333+00:00

    Hello,

    XamarinMediaManager is a third-party control. I notice you have opened an issue about Java.Lang.NoClassDefFoundError com.google.android.exoplayer2.source.ConcatenatingMediaSource in version 1.2.2 in the GitHub, please waiting for update in the XamarinMediaManager github page.

    I notice you use MAUI, you can use MediaElement to play audio and video in iOS and Android.

    Best Regards,

    Leon Lu


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


1 additional answer

Sort by: Most helpful
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.