SandroMachado / openalpr-android

Android Automatic License Plate Recognition library (http://www.openalpr.com) ported for android.
Apache License 2.0
770 stars 272 forks source link

Building problems. Duplicate entries in BuildConfig.class #37

Open k3t0 opened 7 years ago

k3t0 commented 7 years ago

Dear Sandro,

thank you for putting this together. Unfortunately the build process fails for me for both release v1.1.1 and v1.1.0. I'm building with Studio 2.2.3 and JRE 1.8.0_76-release-b03-amd64 and try to run on

If I clean and rebuild the app, the building works, but when I try to run the app I get:

Error:Execution failed for task ':app:transformClassesWithDexForDebug'. com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/usr/local/android-studio/jre/bin/java'' finished with non-zero exit value 2

If I use the option:

   multiDexEnabled true

I get: Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'. com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/sandro/openalpr/BuildConfig.class

Thank you for any help on this, k3t0

SandroMachado commented 7 years ago

Hi @k3t0

Can you try to use in your project the buildToolsVersion "23.0.1"?

k3t0 commented 7 years ago

Dear Sandro,

thank you for your reply.

I'm trying to compile and run an unmodified version of your code. So, I was using buildToolsVersion "23.0.1". I'm now trying to run on a Marshmallow system, but I get the same error.

If I simply build the project, all is well and it logs build successful. Once I try to run/build the apk, however, it exits with the error message shown above.

I understand it's not your job helping me solve my setup issues. Still I'd appreciate any help/idea. Kind regards, k3t0

SandroMachado commented 7 years ago

@k3t0 you need to disable instant run. Can you please try it and give feedback?

DipuDipanshu commented 7 years ago

ya I'm getting the same error...in spite of following your all instruction

ThinkingXuan commented 7 years ago

I'm getting the same error...in spite of following your all instruction too.

pedrolaranjeiro commented 6 years ago

I had a similar issue. My project had a library module and I had the same package name for both app and library. This was creating the conflict. After I change the library name in the AndroidManifest, it compiled.

mehulTank commented 5 years ago

i am getting same issue my version is 28 how can i solve this i have add already added multidex but still not working