How to fix the “Conversion to Dalvik format failed with error 1″ with ADT 14

Today I updated my SDK and ADT to the 14 version and I had a big problem !!

Every project I had which used Android Library Project couldn’t be launched on a terminal and crashed during the APK generation with the following error :

UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.IllegalArgumentException: already added: Lcom/foxykeep/datadroid/config/LogConfig;
[2011-10-19 15:19:18 - MyProject] Dx 	at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:123)
[2011-10-19 15:19:18 - MyProject] Dx 	at com.android.dx.dex.file.DexFile.add(DexFile.java:163)
[2011-10-19 15:19:18 - MyProject] Dx 	at com.android.dx.command.dexer.Main.processClass(Main.java:486)
[2011-10-19 15:19:18 - MyProject] Dx 	at com.android.dx.command.dexer.Main.processFileBytes(Main.java:455)
[2011-10-19 15:19:18 - MyProject] Dx 	at com.android.dx.command.dexer.Main.access$400(Main.java:67)
[2011-10-19 15:19:18 - MyProject] Dx 	at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:394)
[2011-10-19 15:19:18 - MyProject] Dx 	at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:245)
[2011-10-19 15:19:18 - MyProject] Dx 	at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:131)
[2011-10-19 15:19:18 - MyProject] Dx 	at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:109)
[2011-10-19 15:19:18 - MyProject] Dx 	at com.android.dx.command.dexer.Main.processOne(Main.java:418)
[2011-10-19 15:19:18 - MyProject] Dx 	at com.android.dx.command.dexer.Main.processAllFiles(Main.java:329)
[2011-10-19 15:19:18 - MyProject] Dx 	at com.android.dx.command.dexer.Main.run(Main.java:206)
[2011-10-19 15:19:18 - MyProject] Dx 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[2011-10-19 15:19:18 - MyProject] Dx 	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
[2011-10-19 15:19:18 - MyProject] Dx 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
[2011-10-19 15:19:18 - MyProject] Dx 	at java.lang.reflect.Method.invoke(Unknown Source)
[2011-10-19 15:19:18 - MyProject] Dx 	at com.android.ide.eclipse.adt.internal.build.DexWrapper.run(DexWrapper.java:179)
[2011-10-19 15:19:18 - MyProject] Dx 	at com.android.ide.eclipse.adt.internal.build.BuildHelper.executeDx(BuildHelper.java:729)
[2011-10-19 15:19:18 - MyProject] Dx 	at com.android.ide.eclipse.adt.internal.build.builders.PostCompilerBuilder.build(PostCompilerBuilder.java:602)
[2011-10-19 15:19:18 - MyProject] Dx 	at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:629)
[2011-10-19 15:19:18 - MyProject] Dx 	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
[2011-10-19 15:19:18 - MyProject] Dx 	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:172)
[2011-10-19 15:19:18 - MyProject] Dx 	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:282)
[2011-10-19 15:19:18 - MyProject] Dx 	at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:363)
[2011-10-19 15:19:18 - MyProject] Dx 	at org.eclipse.core.internal.resources.Project$1.run(Project.java:545)
[2011-10-19 15:19:18 - MyProject] Dx 	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1975)
[2011-10-19 15:19:18 - MyProject] Dx 	at org.eclipse.core.internal.resources.Project.internalBuild(Project.java:524)
[2011-10-19 15:19:18 - MyProject] Dx 	at org.eclipse.core.internal.resources.Project.build(Project.java:123)
[2011-10-19 15:19:18 - MyProject] Dx 	at com.android.ide.eclipse.adt.internal.project.ProjectHelper.build(ProjectHelper.java:869)
[2011-10-19 15:19:18 - MyProject] Dx 	at com.android.ide.eclipse.adt.internal.launch.LaunchConfigDelegate.launch(LaunchConfigDelegate.java:146)
[2011-10-19 15:19:18 - MyProject] Dx 	at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:853)
[2011-10-19 15:19:18 - MyProject] Dx 	at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:702)
[2011-10-19 15:19:18 - MyProject] Dx 	at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:924)
[2011-10-19 15:19:18 - MyProject] Dx 	at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1128)
[2011-10-19 15:19:18 - MyProject] Dx 	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
[2011-10-19 15:19:18 - MyProject] Dx
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.IllegalArgumentException: already added: Lgreendroid/app/ActionBarActivity;
[2011-10-19 15:19:18 - MyProject] Dx 	at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:123)
[2011-10-19 15:19:18 - MyProject] Dx 	at com.android.dx.dex.file.DexFile.add(DexFile.java:163)
[2011-10-19 15:19:18 - MyProject] Dx 	at com.android.dx.command.dexer.Main.processClass(Main.java:486)
[2011-10-19 15:19:18 - MyProject] Dx 	at com.android.dx.command.dexer.Main.processFileBytes(Main.java:455)
[2011-10-19 15:19:18 - MyProject] Dx 	at com.android.dx.command.dexer.Main.access$400(Main.java:67)
[2011-10-19 15:19:18 - MyProject] Dx 	at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:394)
[2011-10-19 15:19:18 - MyProject] Dx 	at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:245)
[2011-10-19 15:19:18 - MyProject] Dx 	at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:131)
[2011-10-19 15:19:18 - MyProject] Dx 	at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:109)
[2011-10-19 15:19:18 - MyProject] Dx 	at com.android.dx.command.dexer.Main.processOne(Main.java:418)
[2011-10-19 15:19:18 - MyProject] Dx 	at com.android.dx.command.dexer.Main.processAllFiles(Main.java:329)
[2011-10-19 15:19:18 - MyProject] Dx 	at com.android.dx.command.dexer.Main.run(Main.java:206)
[2011-10-19 15:19:18 - MyProject] Dx 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[2011-10-19 15:19:18 - MyProject] Dx 	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
[2011-10-19 15:19:18 - MyProject] Dx 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
[2011-10-19 15:19:18 - MyProject] Dx 	at java.lang.reflect.Method.invoke(Unknown Source)
[2011-10-19 15:19:18 - MyProject] Dx 	at com.android.ide.eclipse.adt.internal.build.DexWrapper.run(DexWrapper.java:179)
[2011-10-19 15:19:18 - MyProject] Dx 	at com.android.ide.eclipse.adt.internal.build.BuildHelper.executeDx(BuildHelper.java:729)
[2011-10-19 15:19:18 - MyProject] Dx 	at com.android.ide.eclipse.adt.internal.build.builders.PostCompilerBuilder.build(PostCompilerBuilder.java:602)
[2011-10-19 15:19:18 - MyProject] Dx 	at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:629)
[2011-10-19 15:19:18 - MyProject] Dx 	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
[2011-10-19 15:19:18 - MyProject] Dx 	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:172)
[2011-10-19 15:19:18 - MyProject] Dx 	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:282)
[2011-10-19 15:19:18 - MyProject] Dx 	at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:363)
[2011-10-19 15:19:18 - MyProject] Dx 	at org.eclipse.core.internal.resources.Project$1.run(Project.java:545)
[2011-10-19 15:19:18 - MyProject] Dx 	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1975)
[2011-10-19 15:19:18 - MyProject] Dx 	at org.eclipse.core.internal.resources.Project.internalBuild(Project.java:524)
[2011-10-19 15:19:18 - MyProject] Dx 	at org.eclipse.core.internal.resources.Project.build(Project.java:123)
[2011-10-19 15:19:18 - MyProject] Dx 	at com.android.ide.eclipse.adt.internal.project.ProjectHelper.build(ProjectHelper.java:869)
[2011-10-19 15:19:18 - MyProject] Dx 	at com.android.ide.eclipse.adt.internal.launch.LaunchConfigDelegate.launch(LaunchConfigDelegate.java:146)
[2011-10-19 15:19:18 - MyProject] Dx 	at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:853)
[2011-10-19 15:19:18 - MyProject] Dx 	at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:702)
[2011-10-19 15:19:18 - MyProject] Dx 	at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:924)
[2011-10-19 15:19:18 - MyProject] Dx 	at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1128)
[2011-10-19 15:19:18 - MyProject] Dx 	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
[2011-10-19 15:19:23 - MyProject] Dx warning: Ignoring InnerClasses attribute for an anonymous inner class
(org.ksoap2.transport.KeepAliveHttpsTransportSE$1) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
[2011-10-19 15:19:23 - MyProject] Dx 2 errors; aborting
[2011-10-19 15:19:23 - MyProject] Conversion to Dalvik format failed with error 1

After searching the web and finding this existing bug in the Android bugtracker, I found the reason of this crash . Below you can see my project hierarchy before and after the update from ADT 12 to ADT 14 :

There is only 3 visible differences : “Library Projects” and a “bin” folder and the “default.properties” has been rename to “project.properties”.

The problem here is that the Library Projects elements contains for each Android Library Projects a jar file with the source code. At the same time we still have the GreenDroid_src and DataDroid_src elements which also contains the source code of the libraries. So we have duplicated code in our projects as mentioned in the error.

I think the update should have removed the useless X_src elements but it’s not the case. So we will have to do it manually :

  1. For each X_src element,right click on it and then Build Path > Remove from build path.
  2. A popup will open. Make sure that “Also unlink the folder from the project” is checked and then accept it.
Your project should changed from the left image to the right one :

Now you can launch your project and it should work !

Ice Cream Sandwich launch date and arrival of the sculpture

Update : The video of the arrival of the sculpture is now on Youtube ! You can see it at the bottom of the post.

The launch date for Ice Cream Sandwich is finally revealed !

The event will take place October 19th at 10:00 AM in Hong Kong. So October 18th at 10h PM EST or October 19th at 4:00 AM in Europe.

As you can see in the above image, it will be livestreamed on Youtube at the following link : youtube.com/android and the topic will be Ice Cream Sandwich and the Galaxy Nexus/Nexus Prime.

 

Other news : the Ice Cream Sandwich sculpture has arrived on the Googleplex !

As you normally know, for each release, the arrival of the sculpture on the Googleplex is nearly the last step of the process ! So it looks really good ;)

Here is the video of its arrival :

Some news and info about my trip to London for the DroidCon UK

First news : I think you have just seen it, but this post is in English. And from now most posts will be in this language. The reason will come in the next news ! As you will maybe see, English is not my native language so I hope I will make as few mistakes as possible !

Second news : beginning January 2012, I will be working in San Francisco at Funzio. I just signed my contract with them last week so it’s really fresh news ! It will be a giant change for me, moving from France to the USA, as well as having to work in English. But I think it will be a really nice experience !

 

The final news is my trip to London for the DroidCon UK. Last year I couldn’t get there due to an complicated schedule but this time I’m attending it !

Droidcon London Oct 6-7

Like last year, Thrusday will be the barcamp where all the persons attending the event will be able to either make or view conferences. I wanted to make a presentation about DataDroid but I have not found the time to prepare it so maybe another time !

There will be also a democamp Thrusday evening where it will be possible to make applications demos. Through the PAUG, I think I will demo either WishList or DataDroid depending of the type of presentations !

Friday will be the “conference” day ! And currently I clearly don’t know which conference I will attend and which one I will skip. There is too many choices !  (36 conferences …) ^^

So it will be two busy but interesting days ! I’m really looking forward to it ! I will make a post about it next week ;)

Aion Profile Viewer est disponible sur l’Android Market

Une nouvelle application rejoint WishList et DataDroid dans les rangs des applications que j’ai développé : Aion Profile Viewer !

Comme son nom l’indique, elle est associé au MMORPG Aion Online et permet de rechercher des personnages et de voir leurs informations (statistiques, équipement, compétences spéciales, …) depuis votre téléphone Android.

La version 1.0 est disponible sur le Market et permet de faire les actions suivantes :

  • Recherche de personnages sur les serveurs officiels Européens et Américains
  • Affichage des statistiques d’un personnage
  • Affichage de l’équipement et des informations de chaque arme/armure d’un personnage
  • Affichage des stigmas (compétences spéciales) d’un personnage
  • Affichage des statistiques abyssales (JcJ – Joueur contre Joueur)
  • Ajout d’un profil en favoris pour un accès rapide

L’application est disponible gratuitement sur le Market (en traduction française et anglaise) pour les terminaux Android en version 2.1+ :

Et histoire de vous donner envie dela télécharger, voila quelques screenshots de l’application :

Côté technique, l’application utilise 2 librairies de développement :

  • La magnifique librairie de Cyril Mottier, GreenDroid, principalement les ActionBars et l’AsyncImageView
  • Ma librairie DataDroid pour toute la partie gestion des webservices et des données locales

(Aion et tous les logos et designs associés sont la propriété de NcSoft)

WishList passe en version 1.1

Une nouvelle version de mon application WishList vient d’être publiée sur l’Android Market.

Pour rappel cette application a pour but de se souvenir à votre place de vos idées de cadeaux et donc de toujours les avoir sous la main. Il est possible pour chaque souhait de donner plusieurs éléments : un nom, un prix, une date d’achat, une priorité, un lien vers une page web.

Suite aux retours utilisateurs, cette nouvelle version apporte plusieurs nouvelles fonctionnalités :
  • Ajout d’une fonctionnalité de partage d’un souhait via email/twitter/sms/….
  • Ajout d’un écran de détail permettant de voir toutes les informations d’un souhait.
  • Le lien vers la page web est maintenant cliquable sur l’écran de détail et permet donc d’aller sur le site web
  • Un entête est visible sur la liste des souhaits et permet de savoir le nombre de souhaits ainsi que le montant total
  • Amélioration de la visibilité du sens du tri de la liste (des flèches ont été ajoutées aux pictos)
  • Un nouveau champ permet de noter la personne avec qui on a partagé un souhait. Il est possible de sélectionner la personne depuis sa liste des contacts.
  • Des nouveaux pictos permettent de voir dans la liste si un souhait a une page web associée et si il a été noté comme partagé avec quelqu’un
  • Ajout d’un écran de préférences accessible via le menu sur la liste des souhaits
  • Ajout de fonctionnalité de sauvegarde et de restoration. Les souhaits sont sauvés dans un fichier texte sur la carte SD. Vous pouvez accéder à ces fonctionnalités via l’écran de préférences.
L’application est disponible sur le Market (en traduction française et anglais) pour les téléphones Android 2.1+ :
WishList QRCode
Et histoire de vous motiver, quelques screenshots de l’application :

Page optimized by WP Minify WordPress Plugin