Error Gradle when generate apk in Android Studio: Exception parsing classes
<p>I have a problem when I generate signed Apk file in Android studio. I get a messages below:</p>

<pre><code>Error:Error converting bytecode to dex:
Cause: java.lang.RuntimeException: Exception parsing classes
Error:1 error; aborting
:app:transformClassesWithDexForRelease FAILED
Error:Execution failed for task ':app:transformClassesWithDexForRelease'.
&gt; com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.7.0_67\bin\java.exe'' finished with non-zero exit value 1
</code></pre>

<p>I use proguard in build gradle:</p>

<pre><code>classpath 'com.android.tools.build:gradle:2.1.0'
</code></pre>

<p>I was searching through many existing answers, but it's not worked.
I refer <a href="https://stackoverflow.com/questions/35680979/error-converting-bytecode-to-dex-cause-java-lang-runtimeexception-exception-p">this topic</a>, but i can not find anything like this.</p>

<p>When try to use <code>gradlew assembleRelease</code>, I find the message:</p>

<pre><code>Cause: java.lang.RuntimeException: Exception parsing classes
    UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.RuntimeException: Exception parsing classes
        at com.android.dx.command.dexer.Main.processClass(Main.java:761)
        at com.android.dx.command.dexer.Main.processFileBytes(Main.java:727)
        at com.android.dx.command.dexer.Main.access$1200(Main.java:87)
        at com.android.dx.command.dexer.Main$FileBytesConsumer.processFileBytes(Main.java:1655)
        at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:284)
        at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166)
        at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
        at com.android.dx.command.dexer.Main.processOne(Main.java:681)
        at com.android.dx.command.dexer.Main.processAllFiles(Main.java:578)
        at com.android.dx.command.dexer.Main.runMonoDex(Main.java:315)
        at com.android.dx.command.dexer.Main.run(Main.java:286)
        at com.android.builder.internal.compiler.DexWrapper.run(DexWrapper.java:52)
        at com.android.builder.core.AndroidBuilder$2.call(AndroidBuilder.java:1511)
        at com.android.builder.core.AndroidBuilder$2.call(AndroidBuilder.java:1507)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)
Caused by: com.android.dx.cf.iface.ParseException: name already added: string{"a"}
        at com.android.dx.cf.direct.AttributeListParser.parse(AttributeListParser.java:156)
        at com.android.dx.cf.direct.AttributeListParser.parseIfNecessary(AttributeListParser.java:115)
        at com.android.dx.cf.direct.AttributeListParser.getEndOffset(AttributeListParser.java:96)
        at com.android.dx.cf.direct.MemberListParser.parse(MemberListParser.java:213)
        at com.android.dx.cf.direct.MemberListParser.parseIfNecessary(MemberListParser.java:108)
        at com.android.dx.cf.direct.FieldListParser.getList(FieldListParser.java:54)
        at com.android.dx.cf.direct.DirectClassFile.parse0(DirectClassFile.java:536)
        at com.android.dx.cf.direct.DirectClassFile.parse(DirectClassFile.java:406)
        at com.android.dx.cf.direct.DirectClassFile.parseToInterfacesIfNecessary(DirectClassFile.java:388)
        at com.android.dx.cf.direct.DirectClassFile.getMagic(DirectClassFile.java:251)
        at com.android.dx.command.dexer.Main.parseClass(Main.java:773)
        at com.android.dx.command.dexer.Main.access$1600(Main.java:87)
        at com.android.dx.command.dexer.Main$ClassParserTask.call(Main.java:1694)
        at com.android.dx.command.dexer.Main.processClass(Main.java:758)
        ... 17 more
Caused by: java.lang.IllegalArgumentException: name already added: string{"a"}
        at com.android.dx.rop.annotation.Annotation.add(Annotation.java:208)
        at com.android.dx.cf.direct.AnnotationParser.parseAnnotation(AnnotationParser.java:264)
        at com.android.dx.cf.direct.AnnotationParser.parseAnnotations(AnnotationParser.java:223)
        at com.android.dx.cf.direct.AnnotationParser.parseAnnotationAttribute(AnnotationParser.java:152)
        at com.android.dx.cf.direct.StdAttributeFactory.runtimeVisibleAnnotations(StdAttributeFactory.java:632)
        at com.android.dx.cf.direct.AnnotationParser.parseAnnotations(AnnotationPa
        at com.android.dx.cf.direct.AnnotationParser.parseAnnotationAttribute(Anno
        at com.android.dx.cf.direct.StdAttributeFactory.runtimeVisibleAnnotations(
        at com.android.dx.cf.direct.StdAttributeFactory.parse0(StdAttributeFactory
        at com.android.dx.cf.direct.AttributeFactory.parse(AttributeFactory.java:9
        at com.android.dx.cf.direct.AttributeListParser.parse(AttributeListParser.
        ... 30 more

1 error; aborting
:app:transformClassesWithDexForRelease FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:transformClassesWithDexForRelease'.
&gt; com.android.build.api.transform.TransformException: com.android.ide.common.proce
s.ProcessException: Return code 1 for dex process

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug op

BUILD FAILED
</code></pre>

<p>I tried create new project and copy all gradle, proguard-pro and it build ok.
I don't know why? 
What can be other possible solution please ?</p>