这个类文件的jar包含容器Android 2.0.1,不允许修改 [英] The Jar of this class file blongs to container Android 2.0.1 which does not allow modifications

查看:214
本文介绍了这个类文件的jar包含容器Android 2.0.1,不允许修改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可以任何一个提供我解决这个错误,我已经搜索了这个问题,但失败了

can any one provide me solution to this error i have searched alot to this problem but failed

我正在使用eclipse与ADT

i am using eclipse with ADT

与android sdk 2.0.1

操作系统Microsoft Windows VIsta x86

with android sdk 2.0.1
OS Microsoft windows VIsta x86

推荐答案

这个文章使Eclipse显示Android的源(来自Malcolm Rowe)帮助? (对于SDK1.5,适应2.0)

Does this article "Making Eclipse show Android’s source" (from Malcolm Rowe) help? (for SDK1.5, adapt it for 2.0)


一旦你有源JAR,你通常会希望直接附加它到Eclipse中的库,但这并不适用于Android SDK。 Eclipse说:

Once you have a source JAR, you’d normally expect to just attach it directly to the library in Eclipse, but that doesn’t work with the Android SDK. Eclipse says:


此类文件的JAR属于容器Android 1.5,不允许对其条目对源附件进行修改。

"The JAR of this class file belongs to container ‘Android 1.5’ which does not allow modifications to source attachments on its entries."

这是一个迂回的方式说源路径是固定的。

如果你打开Eclipse项目属性对话框,更改为 Java Build Path 页面和选项卡,然后展开' Android 1.5 '库容器,然后是$ code> android.jar file(phew!),你会看到'$ code>源附件'选项,显示源的预期位置。

Which is a roundabout way of saying that the source path is fixed.
If you open up the Eclipse project properties dialog, change to the Java Build Path page and Libraries tab, then expand the ‘Android 1.5’ library container and then the android.jar file (phew!), you’ll see the ‘Source attachment’ option, which shows where the source is expected to be.


Android 1.5 SDK,这是SDK 位置/平台/ android-1.5 / sources (可能类似于Android 1.1目标),其中SDK Locat ion是在'工作区首选项'Android页面中设置的路径。

请注意,1.0 SDK(当然只支持1.0目标)只需将字符串源附加到SDK位置,假设SDK位置以尾部斜线结束。 (这应该只是需要注意的事情,如果你需要目标1.0;我很确定它是修复在1.1 SDK附带的插件。)

For the Android 1.5 SDK, this is SDK Location/platforms/android-1.5/sources (and presumably similarly for the Android 1.1 target), where SDK Location is the path set in the ‘workspace preferences’ Android page.
Note that the 1.0 SDK (which only supported the 1.0 target, of course) just appends the string sources to the SDK Location, on the assumption that the SDK location ended with a trailing slash. (This should only be something to look out for if you need to target 1.0; I’m pretty sure it was fixed in the plugin provided with the 1.1 SDK.)

将源JAR放在正确的位置有两种方法。

There are two ways to put the source JAR into the right place.


  • 常规方法是在 platforms / android-1.5 / (或 1.1 ),然后将JAR(这是一个ZIP文件)解压缩到该目录中。但是,虽然源没有扩展名,但是Eclipse并不需要它作为一个目录,所以一个简单的方法只是重命名你的源JAR,以便它被称为源,并将其移动到相关目录。

  • The conventional way is to create a directory called sources/ under platforms/android-1.5/ (or 1.1), and then unzip the JAR (which is just a ZIP file) into that directory.
  • However, although sources doesn’t have an extension, Eclipse doesn’t actually require it to be a directory, so a simpler way is just to rename your source JAR so that it’s called sources, and move it into the relevant directory.

将文件或文件移动到正确的位置后,您只需要让Eclipse记下它。我发现只要重新启动Eclipse就足够了,但是如果这不行,你可以随时尝试刷新项目,或通过上下文菜单关闭并重新打开项目。

Once you’ve moved the file or files into the right places, you just need to get Eclipse to take note of it. I found that just restarting Eclipse was enough, but if that doesn’t work you could always try refreshing the project, or closing and re-opening the project via the context menus.

这篇关于这个类文件的jar包含容器Android 2.0.1,不允许修改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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