ResourceType For resource entry index is beyond type entryCount

白昼怎懂夜的黑 提交于 2019-12-10 14:36:48

问题


I use Android Studio 3.2. When I clean/rebuild project I see these warnings in build tool window:

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)

As you can see there is no address to any file to be checked out. I also try Google and saw this and this questions, but I could not find any thing that helps me. How I can solve this problem?


回答1:


I think Itamar is right pointing the finger on "...the compiler is not linking the resources of that package properly to your app because they are intended for different Android SDK versions..."

I had same issue, but following AS' hint I found the solution here: https://chris.banes.me/2016/02/25/appcompat-vector/#enabling-the-flag

androidstudio screenshot




回答2:


To better understand your problem take your compiled APK. In it, there is a file called "resources.arsc". This is compressed and compiled resource file. To be able to read it run:

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

So now you'll have a text file with a description of all the resources in your app. In it, there are a lot of segments looking like this:

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

In this section, you can see there are 2 configurations and 5 entries expected. What you should do to get a hint of what's going on is to look for example at:

resource 0x0101053d

That appears in your log and see where is in the section. It should give you a hint of what resource group in your app is causing it. I would guess you are linking with a package that is very old and so the compiler is not linking the resources of that package properly to your app because they are intended for different Android SDK versions for example. I'm sorry that I can't help much more.

If you have more info leave a comment for this answer and I'll try to help.



来源:https://stackoverflow.com/questions/52809946/resourcetype-for-resource-entry-index-is-beyond-type-entrycount

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!