Conversion to Dalvik format failed with error 2

Common bugs/problems with the Android SDK the Emulator and the ADT-Plugin.

Conversion to Dalvik format failed with error 2

Postby pbo » Tue Feb 19, 2008 9:57 am

Hi,

I have installed the latest SDK and Eclipse plug-in and I can no more generate the apk file due to DEX conversion failure. The console shows the following messages :

(...)
trouble processing:
[2008-02-19 09:39:43 - SLVAndroid] truncated annotation attribute
...while parsing RuntimeVisibleAnnotations attribute at offset 00000175
...while parsing attributes[1]
...while parsing javax/xml/bind/annotation/XmlNs.class
...while processing javax/xml/bind/annotation/XmlNs.class
(...)
trouble processing:
[2008-02-19 09:39:43 - SLVAndroid] truncated annotation attribute
...while parsing AnnotationDefault attribute at offset 000002b8
...while parsing attributes[0]
...while parsing methods[0]
...while parsing javax/xml/bind/annotation/XmlSchema.class
...while processing javax/xml/bind/annotation/XmlSchema.class
(...)
[2008-02-19 09:39:43 - SLVAndroid] 2 warnings
[2008-02-19 09:39:43 - SLVAndroid]
trouble writing output: not found
[2008-02-19 09:39:43 - SLVAndroid] Conversion to Dalvik format failed with error 2

It seems that the conversion to Dalvik format failed for the library jaxb-api-2.1.jar I am using, do you know how I can bypass this issue so that I can generate the application and deploy it on the emulator (no apk is generated).

Thank you,
Phil.
pbo
Freshman
Freshman
 
Posts: 2
Joined: Tue Feb 19, 2008 9:45 am

Top

Postby plusminus » Tue Feb 19, 2008 5:40 pm

Hello Phil,

I found the following on GoogleGroups:
http://groups.google.com/group/android- ... c986b903e0

It seems to happen when you have an Annotation with a value, like:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. @Foo(name ="bar")
  2.  
  3. public class Someclass
  4.  
  5. {
  6.  
  7.  
  8.  
  9. }
Parsed in 0.031 seconds, using GeSHi 1.0.8.4


Probably won't be able to help you further... :?

Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Postby pbo » Tue Feb 19, 2008 5:59 pm

I do not have annotation on my own classes, I am just using the annotation API to test whether classes have annotations or not such as in the following code :

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.                 try {
  2.  
  3.                         XmlType typeAnnotation = dataType.getAnnotation(XmlType.class);
  4.  
  5.                         if( typeAnnotation != null )
  6.  
  7.                                 return typeAnnotation.name();
  8.  
  9.                 } catch (UnsupportedOperationException e) {
  10.  
  11.                 }
Parsed in 0.031 seconds, using GeSHi 1.0.8.4


This worked fine in previous release of Android SDK and Eclipse Plugin but now fails due to what seems to be a bug. Annotations are notably used in SOAP client classes generated from WSDL, and being able to programmatically test presence of annotation allows to have the same code which runs in both runtime environments with/without annotations (eg. standard J2SE environment and Android platform).

Maybe I have to wait for next release of the plugin...

Thank you,
Phil.
pbo
Freshman
Freshman
 
Posts: 2
Joined: Tue Feb 19, 2008 9:45 am

Postby plusminus » Tue Feb 19, 2008 6:14 pm

Think so too. Sounds like a bug.

Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Postby neoecos » Tue Mar 11, 2008 7:39 pm

I'm having the same problem, please check to http://code.google.com/p/android/issues/detail?id=314 to review the status of this issue.
neoecos
Freshman
Freshman
 
Posts: 2
Joined: Tue Mar 11, 2008 7:37 pm
Location: Colombia

Postby neoecos » Thu Mar 20, 2008 6:36 pm

Hi, please take a look http://code.google.com/p/android/issues/detail?id=314 using retrotranslator.

i solved this issue.
neoecos
Freshman
Freshman
 
Posts: 2
Joined: Tue Mar 11, 2008 7:37 pm
Location: Colombia

Top

Postby johnvarenda » Mon Jan 04, 2010 4:09 am

HI...
I too have the same problem.After that i tried your suggestion It leads to a bug.....
Give me the proper solution..
Thanks...
......................



plusminus wrote:Hello Phil,

I found the following on GoogleGroups:
http://groups.google.com/group/android- ... c986b903e0

It seems to happen when you have an Annotation with a value, like:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. @Foo(name ="bar")
  2. public class Someclass
  3. {
  4.  
  5. }
Parsed in 0.034 seconds, using GeSHi 1.0.8.4


Probably won't be able to help you further... :?

Regards,
plusminus
johnvarenda
Once Poster
Once Poster
 
Posts: 1
Joined: Mon Jan 04, 2010 4:06 am

Top

Return to SDK/ADT/Emulator Problems

Who is online

Users browsing this forum: No registered users and 4 guests