3

Possible Duplicate:
“Conversion to Dalvik format failed with error 1” on external JAR

long long time searcher on the site, for several years. Finally I'm stumped and need the help of this forum.

I have a GPS related app that I'm trying now to split into multiple versions for free/paid and also for re-branding purposes. Every attempt to split the project into a library and main has failed with Dalvik error 1. My desire is to have 95% of code in the library which would allow me to easily create rebranded versions and paid/free versions.

I've looked at the tic-tac-toe examples and read many blogs and articles on how to create library projects. So far about 20 hours searching and trying.

Here's my setup

  • XP Pro SP3 with Eclipse Helios Service Release 2 (Build id: 20110218-0911 if it matters)
  • Android SDK tools rev 20.0.3, platform tools rev 14
  • (Also have tried Windows 7 with Helios, same problem)
  • developing for api 7 (family still has older Androids :( )
  • using com.google.android.maps
  • proguard is disabled
  • library is designated through Android project properties only, and added to the main project using the same project properties interface.

My project uses both asynctask subclasses and httpclient if it matters.

Debug build onto my actual device (HTC Desire Z, android 2.3.3) builds fine. actual apk build fails with dalvik error 1. Emulator build works fine as well.

I've read all the Dalvik stuff for tools release 14/15 but since I'm on 20 I hope it's been fixed by now!!

I've tried many different ways and each one has failed with the Dalvik error, including

  • creating new library and main projects in Eclipse, copying classes and res one by one into the new library project (and deleting what I'm pretty sure are unnecessary imports). Changed manifest references to be the library for classes and activities.

  • calling the original project a library and referencing it in a new main project with updated manifest to the library project

  • leaving the original project as is, but moving a single "strings.xml" file into the values folder (figured this one should work, especially since nothing should change in the manifest??)

Always the apk build fails while the debug build on my device works.

What other information can I provide to help with trouble shooting? I'm a total rookie when it comes to reading the error logs... my eyes gloss over.

Thanks in advance for what is probably a very rookie mistake...!

Community
  • 1
  • 1
tiwing
  • 31
  • 2
  • had found that thread before - tried all the steps ... definitely possible I missed a .jar. but creating new projects and manually moving all classes etc. should have eliminated that. Also not using proguard - figured I would get it working without proguard first!! Android.jar is in build path, but under api 2.1 and no way to delete it. – tiwing Oct 16 '12 at 01:47
  • wtf. made new project and library project, and now it seems to work. .. will report back once I move more activities and classes over. could it be that capital letters in the package name was messing with things?? – tiwing Oct 16 '12 at 02:31
  • Can you supply any other logs that come along with the error, e.g. a stack trace from the `dx` tool? "Error 1" is just saying that `dx` exited with exit code `1`, which is what it always does if there's any trouble whatsoever. However, it generally emits some kind of text error message as well, which may help elucidate things. – danfuzz Oct 16 '12 at 02:58
  • actually, I can't.. good news is that with both library and main projects recreated, and all activities and classes copied, it works now. the only difference from before is that package name of the library is all lower case. all that's left in the main project is a string.xml. So, I'm sorry that I can't provide a log of the error, but I"m also thrilled. No idea if it's fluke or if lower case is the answer. Cheers, everyone. – tiwing Oct 16 '12 at 03:42

0 Answers0