Xamarin + Android +绑定YouTube视频播放器编译错误 [英] Xamarin + Android + Binding YouTube video player compile errors

查看:55
本文介绍了Xamarin + Android +绑定YouTube视频播放器编译错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望将YouTubeAndroidPlayerApi.jar绑定到我的Xamarin Android项目中.我已经在Jars文件夹下添加了YouTubeAndroidPlayerApi.jar,但是我的项目无法编译.

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.

错误:请勿覆盖object.Finalize.请使用析构函数."

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>

在Transforms文件夹下的Metadata.xml文件中...似乎并没有将其更改为终结器...我继续在这里使用语法,希望我偶然发现一些可行的方法

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.

谢谢!

推荐答案

您应该可以轻松删除它.但是,您在<attr>中遇到的问题是,您使用了不正确的程序包名称/类名称,因为它应该遵循Java约定(<lowercase package>.<propercase class>).只需确保类似以下示例的情况:

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]" />

这篇关于Xamarin + Android +绑定YouTube视频播放器编译错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆