如何在派生的 IMarketBillingService.java 文件中禁用 eclipse 警告?

发布于 2024-10-29 08:14:45 字数 335 浏览 2 评论 0原文

各位, 我的 Android 应用程序目前有 1 个警告,位于 IMarketBillingService.java 文件的第 80 行,该文件是 Google 新提供的应用内购买代码的一部分。警告内容为:

IMarketBillingService.Stub.Proxy 类型中的方法 getInterfaceDescriptor() 从未在本地使用。

此文件是派生文件,不得编辑。

我意识到我可能会忽略这个警告;然而,我希望我的项目零错误和警告。我发现这是一个有用的原则,特别是在与分布式团队合作时。

有人可以告诉我如何让 eclipse 禁用/忽略这个警告吗?

谢谢。

Folks,
I have android application that presently has 1 warning, in line 80 of the IMarketBillingService.java file that is part of the in-app purchasing code newly supplied by Google. The warning reads:

The method getInterfaceDescriptor() from the type IMarketBillingService.Stub.Proxy is never used locally

This file is a derived file and may not be edited.

I realize that I may ignore this warning; however, I like to have my projects have zero errors and warnings. I find this is a helpful principle, especially when working with distributed teams.

Can someone tell me how to have eclipse disable/ignore this warning?

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

你怎么这么可爱啊 2024-11-05 08:14:45

请留意 Bug ID 220928 的 Eclipse 补丁。一旦运行,您可以抑制 gen 目录中的所有警告。

Look out for eclipse patch for Bug ID 220928. You could suppress all warnings from the gen directory once it is in action.

小ぇ时光︴ 2024-11-05 08:14:45

从 Juno 开始,转到 gen 文件夹的属性并选择忽略可选编译问题
请在此处查看该错误的更广泛解释。

在此处输入图像描述

As of Juno, go the the properties of the gen folder and choose to Ignore optional compile problems.
See a broader explanation of the bug here.

enter image description here

梦与时光遇 2024-11-05 08:14:45

从这个警告我假设该方法是私有方法,对吗?如果您无法编辑该文件,这意味着您无法添加 @SuppressWarnings 指令,我认为您无法禁用此指令。

(您可以更改 eclipse 中的警告设置,但我认为您不希望这样做:))

From this warning I assume that the method is a private method, right? if you can't edit the file, meaning you can't add @SuppressWarnings directive, I don't think you can disable this one.

(You can change the warnings settings in eclipse, but I don't think you want that :) )

家住魔仙堡 2024-11-05 08:14:45

您可以在应用程序中放置一条不执行任何操作的行(假设该方法返回一个字符串),就像

String junk = yourInterfaceName.getInterfaceDescriptor();

这样,但您可能会收到“垃圾未使用”警告,然后您可以对此使用 @SuppressWarnings 指令。

就我个人而言,我可以接受最初的警告,并让团队的其他成员知道“此版本生成 x 个警告,仅此而已”。

You could put a do nothing line in your app (assuming the method returns a String) like

String junk = yourInterfaceName.getInterfaceDescriptor();

That might do it, but then you might get a 'junk is unused' warning which you could then use a @SuppressWarnings directive on that.

Personally I could live with the original warning and let the rest of the team know that 'this build generates x warnings and no more'.

箹锭⒈辈孓 2024-11-05 08:14:45

您可以在本地抑制警告。只需单击“问题”窗格中的下拉菜单,然后单击“配置内容”。然后选择“显示与下面选中的任何配置相匹配的项目”,并选中所有这些。修改标题为“项目上的错误/警告”的内容,并将范围更改为新的工作集,其中包括除 gen 文件夹之外的所有文件夹和文件。

希望这有帮助!

You can suppress the warnings locally. Just click the down menu in the Problems pane, and "Configure contents". Then select "Show items that match any configurations checked below", and check all of them. Modify the one titled "Errors/Warnings on Project" and change the scope to be a new Working Set that includes all folders and files except for the gen folder.

Hope this helps!

我偏爱纯白色 2024-11-05 08:14:45

最正确的解决方案可能是将 IInAppBillingService.aidl 与 iabHelper 一起移动到引用的库项目中,并忽略那里未使用的私有成员,例如 参考

像这样可以摆脱警告,同时仍然会收到实际项目中未使用的私有成员的通知。目前为 gen 启用了忽略可选编译问题

(当它有效时)。

the most proper solution might be to move the IInAppBillingService.aidl along with the iabHelper into a referenced library project and ignore unused private members there, for reference.

like this one can get rid of the warning, while still being notified of unused private members in the actual project. currently having ignore optional compile problems enabled for gen

(while it works).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文