eclipse中 linked resource的使用

一、关于linked resource  
eclipse 中的linkded resources 是指存放在项目所在位置以外某个地方的文件或者文件夹;这些特定的资源必须有一个项目作为他们的父资源。linkded resources可以用来给项目添加某些资源,这些资源因为某些原因必须被报春到项目以外的某个地方。
    你可以使用linked resources来覆盖在workspace中的其他资源;从而使得一个项目的资源可以出现在另外一个项目中;这意味着,一个地方的改变可以使另外一个地方的资源同时发生改变;删除一个资源副本,会导致两个地方的资源同时被删除。
    删除linked resources不会导致资源从文件系统中删除,但是删除linked folder下的资源,则会导致资源从文件系统中被删除。
二、创建linked resource
1).创建一个linked folder
  1. In one of the navigation views, right-click the project where you want to create the new folder.
  2. From the pop-up menu, select New > Folder.
  3. Specify the name of the folder as it will appear in the workbench. This name can be different from the name of the folder in the file system.
  4. Click Advanced.
  5. Check Link to folder in the file system.
  6. Enter a file system path, or click Browse to select a folder in the file system.
  7. Click Finish.

To create a linked file, follow the same steps as above, except choose New > File instead of New > Folder in the context menu.

Linked resource locations can also be specified relative to a variable. This makes it easier to share projects containing linked resources with other team members, since it avoids hard-coded absolute file system paths that may vary from one machine to the next.

To define a linked resource relative to a path variable, do the following after step 5 above:

  1. Click the Variables button.
  2. In the resulting dialog, select an existing path variable or create a new one.
  3. If the chosen variable defines the exact path of the linked resource, click OK. Otherwise, click Extend to specify a file or folder below the location described by the path variable, then click OK.
  4. Click Finish.

Tip: The Window > Preferences > General > Workspace > Linked Resources preference page also allows you to define path variables.

Note that, once you create a linked resource you will not be able to change the link target path that you entered in step 6. or 8. above.


 

参考:elipse 帮助文档

  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
### 回答1: "Android 资源链接失败" 意味着在编译或运行 Android 项目时,系统无法找到或链接到某些所需的资源文件。原因可能是文件缺失、路径错误或名称错误。建议检查项目文件夹的资源文件是否存在、路径是否正确、文件名是否正确。如果问题仍然存在,可能需要清除项目并重新编译或检查错误日志以获取更多信息。 ### 回答2: “Android resource linked failed”意为“Android资源链接失败”。这个错误通常出现在Android应用的开发和构建过程。它意味着Android系统无法找到或链接某个应用所需的资源文件。 通常情况下,这个错误是由于以下几个原因导致的: 1. 资源文件不存在或被删除:这可能是由于应用使用的资源文件被意外删除或移动到其他位置,导致Android系统无法找到所需的文件。 2. 资源文件的命名错误:在Android应用,每个资源文件都有一个唯一的标识符。如果资源文件的命名错误,则Android系统无法正确识别它们。 3. 资源文件的格式错误:在Android应用,每个资源文件都有一个特定的格式要求。如果资源文件的格式不符合要求,则Android系统无法正确加载它们。 解决这个错误的方法取决于具体的原因。以下是一些常见的解决方法: 1. 恢复删除的资源文件:如果某个资源文件被误删除或移动到其他位置,可以从备份恢复它,或重新创建一个新的资源文件。 2. 修复资源文件命名错误:检查应用的资源文件命名是否符合规范。如果发现错误,及时进行更改。 4. 检查资源文件格式:确保资源文件的格式符合Android的要求。如果格式有误,需要进行修改以使其符合要求。 总之,“Android resource linked failed”错误是一个常见的Android应用开发和构建问题。只需要找到问题所在,并采取适当的措施,就可以解决这个问题。 ### 回答3: 当我们在Android Studio创建一个新工程或者导入一个已有的项目时,有时候会遇到 “Android resource linked failed” 的错误提示。这种错误通常是由于资源文件的引用出了问题,导致编译器无法正确链接资源而引起的。 常见情况: 1.缺少资源文件或者资源文件命名不规范。 2.引用的资源文件与实际文件不符合。 3.资源文件过大或者过多,导致Gradle在构建时无法正确处理。 4.资源文件的名称、大小写或者字符集等问题导致编译器无法正确识别。 解决方法: 1.检查资源文件的命名规范,尤其是在布局文件引用的控件ID是否正确。 2.检查一下清单文件有没有缺少声明或者重复声明。 3.检查一下资源文件是否存在、是否良好的格式。 4.尝试重新导入项目,在导入的时候勾选“清理项目”,这将删除构建目录和缓存。 5.在Android Studio清除构建缓存,步骤:File -> Invalidate Caches / Restart。 6.尝试通过命令行构建项目,给出更详细的错误信息,并将其删除或修复。 如果使用上述方法无效,可以尝试使用Gradle插件3.5及以上版本、升级AS至最新版本、以及使用最新的SDK等方法进行优化。总之,逐步排查问题,一定能够找到原因并解决此问题。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值