Newbie Problems with Pipeline in Android

Hi all,

I’ve done a lot of lurking in these forums, but I need to jump in now and ask a question to the community. I’ve done work with Monogame under Windows 10 without issues, but am having trouble porting to Android.

The problem I’m facing is with getting the app to load content from the pipeline tool.

Error: Microsoft.Xna.Framework.Content.ContentLoadException: ‘The content file was not found.’

I am using MonoGame 3.7 and VIsual Studio 2019 Professional with Xamarin,and a virtual emulator. I have tried setting the mgcb file to “AndroidAsset” and “Copy Always” but this has no effect. I thought t this may just be an Android path issue, but I’ve had no luck with changing “Content.RootDirectory = “Content”;” to other values.

I am trying to load content as so:

Texture2D texture = Content.Load(“sprite001”);

Such a call works fine under Windows 10 as the target, but doesn’t port to Android.

I am aware that I can put sprite001.png under the “Assets” folder, and then load it with:

using (var stream = TitleContainer.OpenStream (“Assets/sprite001.png”))
{
texture = Texture2D.FromStream (graphicsDevice, stream);
}

but this is painful and code becomes non-portable; it makes the pipeline tool irrelevant, and I don’t know how to do that with spriteFonts or other content created by the pipeline tool during build. It also creates a mess of loose files in the assets folder, and I want to leverage the power of the pipeline tool.

Thanks!