14

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?

hasanghaforian
  • 13,858
  • 11
  • 76
  • 167

2 Answers2

5

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.

Itamar Kerbel
  • 2,508
  • 1
  • 22
  • 29
  • thanks, I have tried to follow your instructions but didn't found resources which mentioned in gradle output in `my-res.txt`, maybe you have some idea what doest it means? – CAMOBAP Oct 21 '18 at 07:59
  • Hmmmmmmmmm - This is strange. What external libraries to you compile with your project? – Itamar Kerbel Oct 21 '18 at 08:26
  • I have this error in my test app, which use single library is mine one (this test app created specially for manual test of my library). Also this issue appears after update to 3.2.0 version of android gradle plugin – CAMOBAP Oct 21 '18 at 16:16
  • Sorry - Not sure what's causing this. I'm guessing its something to do with the lib resources not compiling properly. Like if the lib was compiled for an older version of the SDK and liked with a new APP. but since this is not the case I'm out of ideas. – Itamar Kerbel Oct 21 '18 at 19:43
  • @zipo13 Thank you for your reply, I tried using `aapt dump --values resources` but could not find desired resource. – hasanghaforian Oct 22 '18 at 05:09
  • Is there any section that have 1155 entrycount? – Itamar Kerbel Oct 22 '18 at 05:22
  • @zipo13 There were no one of `6139`, `134x` or `1155` in output. – hasanghaforian Oct 22 '18 at 05:32
  • I never encountered this error myself but the warning felt so familiar that I was sure it was related to the compiled R file. Now I'm not so sure anymore. Are you like CAMOBAP also have a library you are linking with? I'm sure its related to that but not sure how. – Itamar Kerbel Oct 22 '18 at 06:22
  • I have managed to output this file and can indeed see the resources mentioned in the logcat in this file. They seem to be android resources. My suspicion is something to do with androidx? – StuStirling Mar 07 '19 at 17:20
0

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

FabFab
  • 24
  • 1
  • 3
  • 1
    Thank you. It solved the problem. Please add more details about what must be added to `build.gradle`, so it will be more helpful for others. But one another thing: How do you understand the relation between "error which is appeared in your posted figure" and "my question"? Because I did not see any thing about "resource entry index". – hasanghaforian Nov 01 '18 at 03:57
  • It's not working for me. – Vitaly Jan 20 '22 at 04:25