VerifyError issue with Android 1.5 devices

by Mariano Kamp » Thu, 14 Jan 2010 23:43:57 GMT


Sponsored Links
  got an error message from a user that runs Android 1.5. The error reported
os a java.lang.VerifyError and it seems to be based on the method
setBuildInZoomControls missing. The thing is that this method should be
there on an Android 1.5 device and my app's manifest specifies the minimum
sdk level as "3".

<uses-sdk
android:minSdkVersion="3"
android:targetSdkVersion="4"></uses-sdk>

The documentation for that method says that it is available on level 3:
http://developer.android.com/reference/android/webkit/WebSettings.html#setBuiltInZoomControls(boolean)

So why do I get this error message?

Cheers,
Mariano

Short Excerpt:

01-13 12:08:13.548 I/ActivityManager( 55): Starting activity: Intent {
comp={com.newsrob/com.newsrob.activities.ShowArticleActivity} (has extras) }
*01-13 12:08:13.738 E/dalvikvm( 407): Could not find method
android.webkit.WebSettings.setBuiltInZoomControls, referenced from method
com.newsrob.activities.ShowArticleActivity.createWebView*
01-13 12:08:13.738 W/dalvikvm( 407): VFY: unable to resolve virtual method
248: Landroid/webkit/WebSettings;.setBuiltInZoomControls (Z)V
01-13 12:08:13.738 W/dalvikvm( 407): VFY: rejecting opcode 0x6e at 0x004c
01-13 12:08:13.738 W/dalvikvm( 407): VFY: rejected
Lcom/newsrob/activities/ShowArticleActivity;.createWebView
(Landroid/view/View;)V
01-13 12:08:13.738 W/dalvikvm( 407): Verifier rejected class
Lcom/newsrob/activities/ShowArticleActivity;
01-13 12:08:13.768 W/dalvikvm( 407): Class init failed in newInstance call
(Lcom/newsrob/activities/ShowArticleActivity;)
01-13 12:08:13.768 D/AndroidRuntime( 407): Shutting down VM
01-13 12:08:13.768 W/dalvikvm( 407): threadid=3: thread exiting with
uncaught exception (group=0x4000fe70)
01-13 12:08:13.948 E/NewsRob ( 407): Caught the following exception:
*01-13 12:08:13.948 E/NewsRob ( 407): java.lang.VerifyError:
com.newsrob.activities.ShowArticleActivity*

Longer Excerpt:

01-13 12:08:06.988 D/com.newsrob.AssetContentProvider( 407): onCreate()
01-13 12:08:07.498 D/com.newsrob.storage.SdCardStorageAdapter( 407):
setupMedium status=mounted mounted false->true, read-only false->false,
shared false -> false.
01-13 12:08:07.528 D/NewsRob ( 407): NewsRob.onCreate()
01-13 12:08:07.528 D/NewsRobDefaultExceptionHandler( 407): Default
Exception
handler=com.android.internal.os.runtimeinit$uncaughthand...@43680648
01-13 12:08:07.588 W/NewsRob ( 407): No debug properties loaded.
01-13 12:08:08.348 W/IInputConnectionWrapper( 101): showStatusIcon on
inactive InputConnection
01-13 12:08:08.448 I/ActivityManager( 55): Displayed activity
com.newsrob/.DashboardListActivity: 2653 ms
01-13 12:08:09.758 I/ActivityManager( 55): Starting activity: Intent {
comp={com.newsrob/com.newsrob.activities.FeedListActivity} (has extras) }
01-13 12:08:10.488 I/ActivityManager( 55): Displayed activity
com.newsrob/.activities.FeedListActivity: 729 ms
01-13 12:08:11.258 I/ActivityManager( 55): Starting activity: Intent {
comp={com.newsrob/com.newsrob.activities.ArticleListActivity} (has extras) }
01-13 12:08:11.848 D/dalvikvm( 55): GC freed 15105 objects / 728320 bytes
in 303ms
01-13 12:08:12.168 D/dalvikvm( 407): GC freed 3444 objects / 199360 bytes
in 123ms
01-13 12:08:12.928 I/ActivityManager( 55): Displayed activity
com.newsrob/.activities.ArticleListActivity: 1665 ms
01-13 12:08:13.548 I/ActivityManager( 55): Starting a



VerifyError issue with Android 1.5 devices

by TreKing » Fri, 15 Jan 2010 00:32:30 GMT


  ran into an issue with the Motorola Cliq maps implementation (on 1.5) that
wasn't happening on other phones because that device's particular build
didn't have the correct implementation of the MyLocationOverlay class.

Do you know which device specifically? Sounds like another one of those
awesome device-specific issues. If you know which device, do a search and
see if it's a known issue with it.

Love your app BTW =)

-------------------------------------------------------------------------------------------------
TreKing - Chicago transit tracking app for Android-powered devices
http://sites.google.com/site/rezmobileapps/treking


On Thu, Jan 14, 2010 at 9:43 AM, Mariano Kamp <mariano.k...@gmail.com>wrote:

>


Sponsored Links


VerifyError issue with Android 1.5 devices

by Mariano Kamp » Fri, 15 Jan 2010 00:56:53 GMT


 



Ah, I see. That would make "sense". Then I will revert back my code to use
reflection again and put the zoom controls in the GUI myself if the method
is not there.



Yes, I do. At least about the one user that sent the report:

01-13 12:08:17.068 D/NewsRobDefaultExceptionHandler(  407): -- Android
Version: sdk=3, release=1.5, inc=138607
01-13 12:08:17.068 D/NewsRobDefaultExceptionHandler(  407): -- Custom ROM:
Stock Android
01-13 12:08:17.068 D/NewsRobDefaultExceptionHandler(  407): -- Device:
sapphire
01-13 12:08:17.068 D/NewsRobDefaultExceptionHandler(  407): -- Model: HTC
Magic

Two more users reported in the Market comments it would force close on their
Heroes. Might be the same issue, but it is strange that they didn't send the
automatic bug report then.

I 
googled< http://www.google.com/search?hl=en& ;q=HTC+%2BMagic+%2BsetBuiltInZoomControls+-map+-mapView&aq=f&oq=&aqi=>it,
but didn't find anything, except my post and reports about the Map's
setBuiltInZoomControls method missing.
I'll do the reflection thing from above and hope that I find an affected
user that can try it out.

Love your app BTW =)
Awesome. Thanks for letting me know.
It looks like (see above) you have to suffer through another bugfix update
though ;-)



VerifyError issue with Android 1.5 devices

by fadden » Fri, 15 Jan 2010 06:04:44 GMT


 


One quick thing to try: watch logcat while installing your app,
keeping an eye out for verification errors.

The verifier's behavior changed for certain types of failures in 2.0.
In 1.6 and earlier, illegal access and class/method/field resolution
failures resulted in immediate rejection of the entire class.  In 2.0+
the VM inserts an "always throw" instruction at the point of the
problem, so you don't get an exception unless the bogus code is
actually executed.

The verifier will still whine about it, e.g.:

I/dalvikvm( 1514): Could not find method
other.Mutant.disappearingMethod, referenced from method
Main.testMissingStuff
W/dalvikvm( 1514): VFY: unable to resolve virtual method 16: Lother/
Mutant;.disappearingMethod ()V
D/dalvikvm( 1514): VFY: replacing opcode 0x6e at 0x000d

so if there's a problem you can see it in the logs even if the problem
code isn't being run.


What you really want to do is get a hold of the relevant dex/apk files
and poke through them with "dexdump" to see what's actually there, but
that may not be feasible.



Other Threads

1. Seeking beta testers

Posting this on 'developers' instead of 'discuss' because I strongly
prefer to hit only developers with this "free app" offer.

I have had a very hard time getting any "real" users to volunteer to
be beta testers for my app, despite calls on the app description and
inside the app itself.

...so, if anyone on this list has a need for a basic spread sheet app
and would like to beta test new versions of Shead Spreet for me,
please drop me an email off list.  Don't clutter this thread or the
list any further unless there is something relevant to contribute.

You'll basically get the app for free (well, the beta version anyway,
you would have to purchase it through the Market if you wanted the
subsequent release version I suppose...or maybe I could hook you up;
that's never been an issue in the past since all previous beta testers
were already paid users anyway).

First come, first serve, I'll only accept as many as I feel I need.

Thanks.

Cheers!

--~--~---------~--~----~------------~-------~--~----~

2. Some questions about running HelloWorld?

I have developed a HelloWorld application in Eclipse 3.4. When I ran
it, I came accross a problems. The emulator managed to lunch, but its
CPU occupying rate was staying 100%. It kept some minutes as only
"Android _" with black background in the screen. Are there somebody
tell me why and how to solve it?

After I launched the emulator, console lines as below:
[2009-08-23 16:52:14 - HelloWorld] Android Launch!
[2009-08-23 16:52:14 - HelloWorld] adb is running normally.
[2009-08-23 16:52:14 - HelloWorld] Performing com.test.HelloWorld
activity launch
[2009-08-23 16:52:14 - HelloWorld] Automatic Target Mode: launching
new emulator with compatible AVD 'my_avd'
[2009-08-23 16:52:14 - HelloWorld] Launching a new emulator with
Virtual Device 'my_avd'
[2009-08-23 16:52:28 - HelloWorld] New emulator found: emulator-5554
[2009-08-23 16:52:28 - HelloWorld] Waiting for HOME
('android.process.acore') to be launched...

After I closed the emulator, console lines as below:
[2009-08-23 16:53:18 - Emulator] emulator: emulator window was out of
view and was recentred
[2009-08-23 16:53:18 - Emulator]
[2009-08-23 16:53:18 - HelloWorld] emulator-5554 disconnected!
Cancelling 'com.test.HelloWorld activity launch'!

--~--~---------~--~----~------------~-------~--~----~

3. Can an end user disable 2G data, or GSM function?

4. missing module bootsound

5. Lossless rotation of a jpeg image in Android (without fully decoding the image). How to?

6. Icons showing up in the gallery folder

7. How do I implement onClick for a DialogPreference?