Tell me more ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I am having difficulty loading a soundeffect The path is correct, the .xnb is set to androidassets in the project.

My Root is set to content and the folder structure looks like

  • Assets
    • Content
      • Fonts
      • Sounds

I'm getting the following error message:

UNHANDLED EXCEPTION: System.ArgumentNullException: Argument cannot be null. 02-23 18:40:48.990 I/MonoDroid( 3967): Parameter name: path2

I already imported the xnb to the Content folder under assets.

this.playerCannonSound = this.Game.Content.Load<SoundEffect>("Sounds/PlayerFire"); //Works 
this.atdFont = this.Game.Content.Load<SpriteFont>(@"Fonts/ATDFont");
share|improve this question

closed as too localized by Byte56, Sean Middleditch, bummzack, Tetrad Feb 26 at 4:04

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, see the FAQ.

2 Answers

Without seeing your code, I can't be sure. But it sounds like you're doing something like ContentManager.Load<Texture>(null).

I suggest you trace out (or better yet, debug) and figure out what value you're passing in to the Load method. Where are you calling this from?

Your assets path is correct. If you had a file called boom.mp3 under Sounds, you would need to call Load with "Content/Sounds/boom".

share|improve this answer
I'm tracing out stuff and everything(I actualy haven't been able to setup the VS debugger to work with the android emulator if you know how or point me in the right direction it would be helpful) looks good kinda the problem if i place anything that is not a sound effect/song in the folder it loads fine but to make the example more vivid – Alfredo Alvarez Feb 24 at 4:34
@AlfredoAlvarez you should open another question. Debugging works fine for me -- open VS, hit Debug, and go through the prompts to launch and deploy to the Android emulator. – ashes999 Feb 24 at 14:34

Found the solution to this had to upgrade from monogame 2.5 to 3.0 that got it running.

share|improve this answer
Please use the edit link on your question to add additional information. The Post Answer button should be used only for complete answers to the question. – Sean Middleditch Feb 25 at 5:55

Not the answer you're looking for? Browse other questions tagged or ask your own question.