Delete your debug certificate under ~/.android/debug.keystore
on Linux and Mac OS X; the directory is something like %USERPROFILE%/.android
on Windows.
The Eclipse plugin should then generate a new certificate when you next try to build a debug package. You may need to clean and then build to generate the certificate.
Go to Project » Properties » Java Build Path » Libraries and remove all except the "Android X.Y" (in my case Android 1.5). click OK. Go to Project » Clean » Clean projects selected below » select your project and click OK. That should work.
It is also possible that you have a JAR file located somewhere in your project folders (I had copied the Admob JAR file into my src folder) and THEN added it as a Java Path Library. It does not show up under the Package Explorer, so you don't notice it, but it does get counted twice, causing the dreaded Dalvik error 1.
Another possible reason could be package name conflicts. Suppose you have a package com.abc.xyz
and a class named A.java
inside this package, and another library project (which is added to the dependency of this project) which contains the same com.abc.xyz.A.java
, then you will be getting the exact same error. This means, you have multiple references to the same file A.java
and can't properly build it.
In other ways this may be occurred if you accidentally or knowingly edit/ add any thing in the class path file manually .In certain cases we may add android.jar path manually to classpath file for generating java doc.On removing the that after javadoc generated code will works fine.Please check this too if any one still occurs.
Best Answer
I had the same issue while running my app for first time on newly installed android studio. I checked the
Now it will resolved the error! Try it out!