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

查看:25
本文介绍了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.

谢谢!

推荐答案

你应该能够很容易地删除它.但是,您在 中的问题是您的包名/类名不正确,因为它应该遵循 Java 约定(.;).只需确保如下示例所示的情况:

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:

例如:

<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天全站免登陆