0

I'm using the commonsguy cwac-camera library, as per the demo-layout example, documented in "Working directlly with cameraview".

All is fine referencing camera/ and camera-v9/ as Android library projects in source form (I need Android 2.3 compatibility, that's what camera-v9 is for).

When I switch to using the library via JARs: - cwac-camera-v9-0.6.8.jar only includes CameraFragment and BuildConfig classes, so I need also cwac-camera-0.6.8.jar with the other classes. - including both JARs causes the following self-explaining error when running the project (not at compile time) Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Lcom/commonsware/cwac/camera/BuildConfig;

I could just use the source as library project, or use Gradle, but I want to know if this is a bug to open an issue on Github, or if I'm doing something wrong.

To replicate the error, just clone the demo-layout example add both .jar files to libs folder, and run the project.

1 Answer 1

0

No, this appears to be my fault. They must have changed something in the Gradle build process that I am using to create the JARs. I will try to fix this tomorrow. In the meantime, you could go into the cwac-camera-v9 JAR and try removing the classes in com.commonsware.cwac.camera, leaving only those classes incom.commonsware.cwac.camera.acl.

My apologies for this, and thanks for pointing it out!

3
  • @jrub: I have replaced the camera-v9 JAR for v0.6.8 with one that should not conflict with camera on classes in com.commonsware.cwac.camera. Grab the updated JAR and let me know if you continue encountering problems with it (either here or by filing an issue). Jun 20, 2014 at 10:29
  • they're fine now. Thanks for the nice library!
    – jrub
    Jun 20, 2014 at 14:41
  • @jrub; Glad to hear it fixed your problem. I do need to update my build-a-JAR-from-a-library-project recipe, as the JAR contains R and BuildConfig stuff that I am not using. My fix was to correct another problem -- I had both camera and camera-v9 using the same package name in the manifest, causing both sets of useless classes to be in the same directory. Jun 20, 2014 at 14:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.