2

Everything was working fine in my app. Then, I did a small refactoring and a key component stopped working. When I looked at the LogCat output, this is what I found:

WARN/dalvikvm(488): VFY: unable to resolve virtual method 10830: Ljava/lang/String;.getBytes (Ljava/nio/charset/Charset;)[B
DEBUG/dalvikvm(488): VFY: replacing opcode 0x6e at 0x000e
DEBUG/dalvikvm(488): VFY: dead code 0x0011-0015 in Lcom/appiancorp/tempo/android/service/CommentXmlHttpMessageConverter;.writeInternal (Lcom/appiancorp/tempo/android/model/EntryComment;Lorg/springframework/http/HttpOutputMessage;)V

This was ... surprising, to say the least. I looked at the documentation and the method is there, what gives?

dmon
  • 30,048
  • 8
  • 87
  • 96

1 Answers1

2

The getBytes(Charset) exists in API9 and later. Make sure you are building against this version of the SDK or use the getBytes(String charsetName) which exists in API1.

You can also you the "filter by API level" checkbox in online SDK documentation to gray out methods not available in the version you are building against.

Robby Pond
  • 73,164
  • 16
  • 126
  • 119
  • Ah, I totally missed that. The API level is very subtly displayed in the documentation, sneaky. Thanks! – dmon Apr 05 '11 at 16:38