12

我用Android Studio 3.2. 当我清理/重建项目时,我在build工具窗口中看到这些警告:

W/ResourceType( 6139): For resource 0x0101053d, entry index(1341) is beyond type entryCount(1155)
W/ResourceType( 6139): For resource 0x0101053e, entry index(1342) is beyond type entryCount(1155)
W/ResourceType( 6139): For resource 0x0101053b, entry index(1339) is beyond type entryCount(1155)
W/ResourceType( 6139): For resource 0x0101053c, entry index(1340) is beyond type entryCount(1155)

如您所见,没有任何要签出的文件的地址。我也尝试了谷歌并看到了这个这个问题,但我找不到任何对我有帮助的东西。我该如何解决这个问题?

4

2 回答 2

3

为了更好地理解您的问题,请使用您编译的 APK。其中有一个名为“resources.arsc”的文件。这是压缩和编译的资源文件。为了能够阅读它运行:

aapt dump --values resources myAPK.apk > c:\my-res.txt 

因此,现在您将拥有一个包含应用程序中所有资源描述的文本文件。在其中,有很多部分看起来像这样:

type 3 configCount=2 entryCount=5
  spec resource 0x7f040000 com.LTS.NVMS7000:bool/abc_action_bar_embed_tabs: flags=0x00000080
  spec resource 0x7f040001 com.LTS.NVMS7000:bool/abc_allow_stacked_button_bar: flags=0x00000000
  spec resource 0x7f040002 com.LTS.NVMS7000:bool/abc_config_actionMenuItemAllCaps: flags=0x00000000
  spec resource 0x7f040003 com.LTS.NVMS7000:bool/abc_config_closeDialogWhenTouchOutside: flags=0x00000000
  spec resource 0x7f040004 com.LTS.NVMS7000:bool/abc_config_showMenuShortcutsWhenKeyboardPresent: flags=0x00000000
  config (default):
    resource 0x7f040000 com.LTS.NVMS7000:bool/abc_action_bar_embed_tabs: t=0x12 d=0xffffffff (s=0x0008 r=0x00)
      (color) #ffffffff
    resource 0x7f040001 com.LTS.NVMS7000:bool/abc_allow_stacked_button_bar: t=0x12 d=0x00000000 (s=0x0008 r=0x00)
      (color) #00000000
    resource 0x7f040002 com.LTS.NVMS7000:bool/abc_config_actionMenuItemAllCaps: t=0x12 d=0xffffffff (s=0x0008 r=0x00)
      (color) #ffffffff
    resource 0x7f040003 com.LTS.NVMS7000:bool/abc_config_closeDialogWhenTouchOutside: t=0x12 d=0xffffffff (s=0x0008 r=0x00)
      (color) #ffffffff
    resource 0x7f040004 com.LTS.NVMS7000:bool/abc_config_showMenuShortcutsWhenKeyboardPresent: t=0x12 d=0x00000000 (s=0x0008 r=0x00)
      (color) #00000000
  config port:
    resource 0x7f040000 com.LTS.NVMS7000:bool/abc_action_bar_embed_tabs: t=0x12 d=0x00000000 (s=0x0008 r=0x00)
      (color) #00000000

在本节中,您可以看到预期有 2 个配置和 5 个条目。您应该做的是了解正在发生的事情,例如查看:

资源 0x0101053d

这会出现在您的日志中,并查看该部分的位置。它应该会提示您应用程序中的资源组导致它。我猜您正在链接一个非常旧的包,因此编译器没有将该包的资源正确链接到您的应用程序,因为它们适用于不同的 Android SDK 版本。很抱歉,我不能提供更多帮助。

如果您有更多信息,请对此答案发表评论,我会尽力提供帮助。

于 2018-10-17T07:58:51.157 回答
0

我认为 Itamar 正确地指责“......编译器没有将该包的资源正确链接到您的应用程序,因为它们适用于不同的 Android SDK 版本......”

我有同样的问题,但按照 AS 的提示,我在这里找到了解决方案:https ://chris.banes.me/2016/02/25/appcompat-vector/#enabling-the-flag

安卓工作室截图

于 2018-10-31T18:36:09.903 回答