这一类文件blongs到容器的瓶的Andr​​oid 2.0.1不允许修改不允许、这一类、容器、文件

2023-09-06 13:11:04 作者:输过败过但不曾怕过

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

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的源代码(从马尔科姆·罗)帮助? (为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属于容器的Andr​​oid 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构建路径页和选项卡,然后展开的Andr​​oid 1.5 库容器中,然后在的android.jar 文件(唷!),你会看到 来源附件选项,这显示了源预计。

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 /源(和presumably同样为Android 1.1的目标),其中SDK地点是在工作空间preferences Android的页面设置路径。   需要注意的是1.0 SDK(只支持当然是1.0目标)只是附加字符串源的SDK位置,在该SDK的位置以斜线结束的假设。 (这应该只是东西看出来的,如果你需要的目标1.0。我是pretty的确认它是固定在配备有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.

  在传统的方法是创建在一个名为源/目录平台/ 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.