0

I have included a SpriteFont asset and an mp3 asset in my MonoGame cross platform project, the strange thing is that the the game compiles and runs fine on the iOS simulator but whenever I try to build the game on Android I get warnings like this for the files in the bin directory and in the content directory

/Users/edward/Library/Mobile Documents/com~apple~CloudDocs/apps/Xamarin/Android/Radiant/Android/Content/lights.mp3:

Warning XA0101: @(Content) build action is not supported (XA0101) (Radiant.Droid)

And when I try and run the game, I get a

Could not load score asset as a non content file

I have tried many things such as changing the build actions of various files but nothing has worked.

Community
  • 1
  • 1
electrithm
  • 53
  • 6
  • How are you loading the assets? On android platform, you should place non content files into the Assets folder and use Assets.Open(path); See: https://developer.xamarin.com/guides/android/application_fundamentals/resources_in_android/part_6_-_using_android_assets – dreamwagon Jul 19 '16 at 15:06

2 Answers2

0

This could be an issue of upper case and lower case file names. I've run into this issue before.

If it's not that, you can extract the Android *.apk file like a *.zip file to see what files are actually in there. This can seriously help on figuring out why files aren't being loaded with android.

To Extract

Create a copy of your *.apk file, so that you're not modifying the original.

Change the file extension too *.zip.

Now right click and extract like any other *.zip file.

You can then go in and explore the folder hierarchy to see what files are being included.

Check your Asset folder to see if the file you're looking for is there or not.

Hope this helps.

RT Roe
  • 106
  • 7
0

Are you using the monogame content builder or are you trying to load them in directly as .mp3 .png or whatever?

If you aren't using the content builder everything has to be .xnb on android.

Graham
  • 71
  • 4