James Scott James Scott - 1 month ago 11
Android Question

Xamarin + Android + Binding YouTube video player compile errors

I'm looking to bind the YouTubeAndroidPlayerApi.jar into my Xamarin Android project. I've added the YouTubeAndroidPlayerApi.jar under my Jars folder, but my project won't compile.

Error: "Do not override object.Finalize. Instead use a destructor."

So I've tried to change the way it compiles by using an:

<attr path="/api/package[@name='Com.Google.Android.Youtube.Player']/class[@name='YouTubeThumbnailView']/method[@name='Finalize']" name="managedName">~YouTubeThumbnailView</attr>


In the Metadata.xml file under Transforms folder... It doesn't seem to change it to a finalizer though... I'm continuing to play around with the syntax here in hopes that I stumble across something that works.

Is this the right approach? Is there something else I could be doing that is a better solution? I'd really like some feedback.

Thanks!

Answer

You should just be able to remove this fairly easily. However your issue in your <attr> is the fact that you have the incorrect package name/class name as it should follow Java convention(<lowercase package>.<propercase class>). Simply ensure the case like the example below:

EX:

<remove-node path="/api/package[@name='com.google.android.youtube.player']/class[@name='YouTubeThumbnailView']/method[@name='finalize' and count(parameter)=0]" />