Fields and methods reference count in dex

408 Views Asked by At

Does dex limit is for the methods only ? Does dex have any limits for the fields ? I can not find any information about that, but at least error looks

Too many field references: 131000; max is 65536.

Why not methods in that case ? There is nothing in all google and android documentation about that. At least my googling skills can not help me with that, to find one resource where it will be clearly written. Thanks.

Also, would be great to provide any proof for your answers. Or you're developer at Google.

1

There are 1 best solutions below

0
On

It talks about methods

The Dalvik Executable specification limits the total number of methods that can be referenced within a single DEX file to 65,536—including Android framework methods, library methods, and methods in your own code

Source: https://developer.android.com/studio/build/multidex.html