Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't export signed applications

I have an Eclipse workspace with two Android apps and two Android libraries - the Facebook SDK and my own library. When I try to create APK files, I sometimes get the error "Conversion to dalvik format failed with error 1".

I went through all SO answers to similar questions, but nothing works:

  1. The Facebook SDK library references a jar the wrong way, so I fixed that.
  2. I've cleaned the build. Many times.
  3. I've deleted the bin folders.
  4. This is happening on multiple development machines, but just in case - I've deleted the workspace and started over.

The only fix I found for this was to retry over and over until it works. Other than dropping Android and doing only iOS and Windows Phone versions, what can I do? It's impossible to develop anything this way.

UPDATE: On one of the computers, I get alternating errors, sometimes it's the Dalvik error, another time it complains it can't export ...\facebook-android-sdk-3.0\facebook\bin\facebooksdk.jar .

UPDATE 2: The Eclipse log (.metadata/.log) shows details of the exception:

!ENTRY com.android.ide.eclipse.adt 4 0 2013-04-12 00:14:59.163
!MESSAGE Export Wizard Error
!STACK 1
org.eclipse.core.runtime.CoreException: Conversion to Dalvik format failed with error 1
at com.android.ide.eclipse.adt.internal.project.ExportHelper.exportReleaseApk(ExportHelper.java:312)
at com.android.ide.eclipse.adt.internal.wizards.export.ExportWizard.doExport(ExportWizard.java:296)
at com.android.ide.eclipse.adt.internal.wizards.export.ExportWizard.access$0(ExportWizard.java:233)
at com.android.ide.eclipse.adt.internal.wizards.export.ExportWizard$1.run(ExportWizard.java:218)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
Caused by: com.android.ide.eclipse.adt.internal.build.DexException: Conversion to Dalvik format failed with error 1
at com.android.ide.eclipse.adt.internal.build.BuildHelper.executeDx(BuildHelper.java:751)
at com.android.ide.eclipse.adt.internal.project.ExportHelper.exportReleaseApk(ExportHelper.java:269)
... 4 more

!SUBENTRY 1 com.android.ide.eclipse.adt 4 0 2013-04-12 00:14:59.163
!MESSAGE Conversion to Dalvik format failed with error 1
!STACK 0
com.android.ide.eclipse.adt.internal.build.DexException: Conversion to Dalvik format failed with error 1
at com.android.ide.eclipse.adt.internal.build.BuildHelper.executeDx(BuildHelper.java:751)
at com.android.ide.eclipse.adt.internal.project.ExportHelper.exportReleaseApk(ExportHelper.java:269)
at com.android.ide.eclipse.adt.internal.wizards.export.ExportWizard.doExport(ExportWizard.java:296)
at com.android.ide.eclipse.adt.internal.wizards.export.ExportWizard.access$0(ExportWizard.java:233)
at com.android.ide.eclipse.adt.internal.wizards.export.ExportWizard$1.run(ExportWizard.java:218)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
like image 473
zmbq Avatar asked Feb 17 '23 20:02

zmbq


1 Answers

  1. Disable Menu -> Project -> Build Automatically.
  2. Menu -> Project -> Clean...
  3. Menu -> Project -> Bulid All

Worked for me to export signed application package

like image 166
mvladk Avatar answered Feb 28 '23 13:02

mvladk