开发者

how to solve android verify error?

开发者 https://www.devze.com 2023-02-06 06:45 出处:网络
I am working android application.when i run that application below error occred.please开发者_开发技巧 help me......

I am working android application.when i run that application below error occred.please开发者_开发技巧 help me......

01-20 20:39:02.955: WARN/dalvikvm(5690): VFY: arbitrarily rejecting large method (regs=93 count=23019)
01-20 20:39:02.955: WARN/dalvikvm(5690): VFY:  rejected Lez/com/Action_module_screen;.da ()V
01-20 20:39:02.955: WARN/dalvikvm(5690): Verifier rejected class Lez/com/Action_module_screen;
01-20 20:39:02.955: INFO/System.out(5690): verify Errorez.com.Action_module_screen


Some googling for causes and ways to fix:

From http://www.mentby.com/Group/android-developers/vfy-arbitrarily-rejecting-large-method.html

This means that the value of (number of registers * number of instruction words) is larger than 2^21 [2,097,152].

Your error shows the method may have a lot of parameters and local variables (regs=93) and a large amount of code (instructions count=23019):

`93 registers * 23019 number of instruction words` = 2,140,767
 exceeding the "size" limit of 2,097,152 by 43,615 (2%)

The verifier doesn't think your method is reasonable :-).

I wasn't really expecting anyone to hit this -- it's intended to prevent the verifier from bloating up an app's native heap. Does the method take a large number of arguments, or have lots of local variables? I've also seen some poor behavior when a method had 4 invocations of a call to another method that took 15 arguments; the register allocator freaked out a bit.

The presence or absence of debug information affects the sorts of things the "dx" code optimizer is allowed to do (e.g. some unnecessary instructions will be retained so that the debugger can show something reasonable while single-stepping). Usually the overhead is small, but it may be that you're near the edge and this pushed you over.

Also from http://www.mentby.com/Group/android-developers/verifyerror-arbitrarily-rejecting-large-method.html:

In addition to somehow reducing the width of parallel branching (eg, by placing inner switch statements in their own methods), if you can reduce the number of "global" local variables (method local variables that reach all branch paths) that's likely to help substantially.

Yep, the Dalvik compiler attempts to assign a "register" to every local variable in the method.

I don't favor this approach, but you could also convert some of your method parameters and local variables into instance variables:

By making them instance variables you remove the compiler's need/desire to "manage" them (and also make the method a fair amount smaller).


Here is a link to a similar question.
Your problem is a (93 * 23019) > 2^21 (2^21 = 2097152)

I believe ths short answer is: your method is too large, you need to optimize it to be smaller so that it will fit.


You have a method that is too large in your Errorez.com.Action_module_screen class ("arbitrarily rejecting large method"). It looks like the method in question is da(). Try reducing the size of that method.


it is normally showing that your apk contains code, that is not corresponding the OS version/ level or it has compilation problems. Sometimes it helps to clean the project and rebuiled everything. Probably you should provide a longer stacktrace, if cleaning doesn't help :)

0

精彩评论

暂无评论...
验证码 换一张
取 消