Forum Cross Platform with Xamarin

Media Plugin Nullpointer

does anybody why I get an NullPointer Exception, when I try to use the MediaPlugin in Android.
I think I did it the right way.
1. I set the permissions in AndroidManifest.xml
2. I create a new folder xml and add file_paths.xml
3. I create OnRequestPermissionsResult in the MainActivitiy.cs

but it stops at base.OnCreate(bundle)

Unhandled Exception:

any experience or idea?

Best Answer


  • josemmortegajosemmortega ESUniversity ✭✭✭

    @MartinWunderlich Do you init the service? Also, you can share all the stacktrace to get more info. Thanks!

  • I just follow the points

    In the MainActivity the code crash on this line:

  • GunnarPalssonGunnarPalsson USMember
    edited February 2017

    @MartinWunderlich can you elaborate on your solution? I'm experiencing the same problem and I can't seem to get it to work...

    UPDATE: actually I managed to get this to work by removing the changes I made following the Android N instructions

  • ClausElmannClausElmann DKMember ✭✭

    delete bin and obj folders on Android project and rebuild it

Sign In or Register to comment.