Forum Xamarin Cross Platform with Xamarin

Media Plugin Nullpointer

Hey,
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:
Java.Lang.NullPointerException:

any experience or idea?

Best Answer

Answers

  • 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
    Usage
    and
    Permissions

    In the MainActivity the code crash on this line:
    base.OnCreate(bundle);

  • 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.