Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

Android resources, NullReferenceException thrown at launch

$
0
0

I'm trying to add a sound file to my Xamarin.Forms app. Following https://developer.xamarin.com/recipes/android/media/audio/play_audio/ I created the "raw" directory, placed my file in, and changed the Build Action to AndroidResource. Built the app--which was fine--then ran it. At launch, received a NullReferenceException in MainActivity.OnCreate, in the line "Load Application(new App());"

Removing the resource allows it to run again.

VS 2017 15.5.4
Xamarin 4.8.0.757
Xamarin.Android SDK - 8.1.3.0

What's the problem?


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>