Eclipse的JUNO + ADT 23.0.2资源$ NotFoundException资源、JUNO、Eclipse、ADT

2023-09-07 10:58:57 作者:七分冷酷

在最新的Eclipse ADT捆绑我得到了一个旧的项目,我工作的一些错误:

After I recently installed the latest Eclipse ADT bundle I get some errors in an old project I was working on:

No known package when getting value for resource number 0x7f080028
android.content.res.Resources$NotFoundException: String resource ID #0x7f080028
at android.content.res.Resources.getText(Resources.java:222)
at android.content.res.Resources.getString(Resources.java:275)
at android.content.Context.getString(Context.java:183)
...

在我的R-文件还有就是我要找的字符串和资源ID之间的连接是否正确。

In my R-file there is the correct connection between the string I'm looking for and the resource ID.

我试过几件事情来解决我的问题:

I tried several things to solve my issue:

在干净的所有项目 重新命名所有资源的名称为小写的名字 重新启动计算机

我用ADT-束窗口-x86_64-20130522(它没有运行时错误编译)之前并下载ADT-束窗口,x86_64-20140702,因为一个错误的更新过程中发生了。

I used "adt-bundle-windows-x86_64-20130522" (it compiled without runtime errors) before and downloaded "adt-bundle-windows-x86_64-20140702" because of an error occurred during an update.

有什么建议?

推荐答案

编辑:看起来像新的集结工具的版本(21.0.2)已经发布了解决这个问题!最好的解决方法是,现在升级到这个版本,而不是恢复到旧版本或换出aapt.exe文件。

Looks like a new build-tools version (21.0.2) has been released that addresses this issue! The best fix is now to update to this version, rather than revert to an older version or swap out aapt.exe files.

我的答案很简单:用一个旧版本的Andr​​oid SDK中内建的工具,现在是这样。有可能与包括在版本21和集结工具21.0.1某些类型的资产目录中的文件中的错误 - 或者至少,这就是为什么我在更新后收到错误消息

My short answer: use an older version of the Android SDK Build-tools, for now. There's likely a bug with including certain types of files in the assets directory in versions 21 and 21.0.1 of the build-tools--or at least that's why I was receiving the error messages after updating.

我的回答:

我刚刚花了更好的一半今天上午与同样的问题。无奈的是,只有三分之二的我的工作$ P $项目的psented它,但它至少给了我一个出发点。我发现,失败的项目包括一个zip文件中的资产的文件夹,而工作的项目没有。删除允许所有应用程序来运行该压缩文件,但是这显然不是一个足够好的解决方案。

I just spent the better half of this morning with the same issue. Frustratingly enough, only two out of three of the projects I work on presented it, but it at least gave me a starting point. I found that the failing projects included a zip file in their assets folders while the working project did not. Removing this zip file allowed all apps to run, but that's obviously not a good enough solution.

我要出去肢体这里假设有这么无法正确生成APK,如果有一个zip文件中最新的Andr​​oid SDK中内建工具版本中的错误(版本21和21.0.1)资产文件夹具有特定属性(我没有足够的研究找出确切的触发器)。只是拉拉链的空文本文件是不够的,触发这一点,但我有一个小的13KB zip文件管理。我不知道任何其他类型的文件是否会导致此

I'm going to go out on a limb here and assume that there's a bug in the newest Android SDK Build-tools release (revisions 21 and 21.0.1) that fails to properly build the APK if there's a zip file in the assets folder with certain properties (I didn't research enough to figure out the exact triggers). Just zipping an empty text file wasn't enough to trigger this, but I managed with a small 13KB zip file. I don't know whether any other types of files cause this.

有关立即解决我只是回到使用的构建工具的旧版本。 由于这里看出,涉及到修改项目的.properties 文件包括 sdk.buildtools = 20 (Eclipse的用户)或者 build.gradle 文件以包括 buildToolsVersion20机器人部分(针对Android Studio用户)。第20版的工作让我回去加快速度,而版本21休息,我的应用程序。当前安装的Andr​​oid SDK中内建工具版本的名单可以看出,在Android SDK管理器,在工具。

For an immediate fix I just went back to using an older version of the build tools. As seen here, that involves modifying the project.properties file to include sdk.buildtools=20 (for Eclipse users) or the build.gradle file to include buildToolsVersion "20" to the android section (for Android Studio users). Version 20 worked to get me back up to speed, while version 21 breaks my apps. Your current list of installed Android SDK Build-tools versions can be seen in the Android SDK Manager, under Tools.