Opening Stream Error when loading in Songs for Android

I’m able to load in all other types of assets except mp3 (song) and wav (soundeffect) in my Android project. When attempting to load these I get:

  Message=Opening stream error.
   at Microsoft.Xna.Framework.MonoGameAndroidGameView.UpdateAndRenderFrame()
   at Microsoft.Xna.Framework.MonoGameAndroidGameView.processStateRunning(CancellationToken token)
   at Microsoft.Xna.Framework.MonoGameAndroidGameView.RunIteration(CancellationToken token)
   at Microsoft.Xna.Framework.MonoGameAndroidGameView.<>c__DisplayClass62_0.<WorkerThreadFrameDispatcher>b__0(Object s)
   at Android.App.SyncContext.<>c__DisplayClass3_0.<Send>b__0() in /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Android.App/SyncContext.cs:line 52
   at Java.Lang.Thread.RunnableImplementor.Run() in /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Java.Lang/Thread.cs:line 36
   at Java.Lang.IRunnableInvoker.n_Run(IntPtr jnienv, IntPtr native__this) in /Users/runner/work/1/s/xamarin-android/src/Mono.Android/obj/Release/net6.0/android-31/mcw/Java.Lang.IRunnable.cs:line 84
   at Android.Runtime.JNINativeWrapper.Wrap_JniMarshal_PP_V(_JniMarshal_PP_V callback, IntPtr jnienv, IntPtr klazz) in /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Android.Runtime/JNINativeWrapper.g.cs:line 22

My asset path is correct:

public void LoadContent(ContentManager content,string songRootPath)
            Song = content.Load<Song>($"{songRootPath}/{LocalPath}");

Although I’ll probably create a separate issue for this, I’m also getting the same error when attempting to load in a 1600x1600 png spritesheet. So perhaps its a size issue of some sort? The spritesheet is only 167kb however.

The value you pass to content.Load() is a relative path. songRootPath seems wrong.

here are some examples:

Also, make sure that Content.RootDirectory = “Content”;
and that the name of the asset is without the extension (.xnb).

Yep you were right. I could have sworn I triple checked the path but guess not. In any case, fixed. Thank you.

It’s just bizarre because in other cases when the path was wrong I was instead getting a “Content not found” exception. Weird.