Re: UNEXPECTED TOP-LEVEL EXCEPTION: when dexing depending android project

Skip to first unread message

Sean Owen

Aug 16, 2012, 3:17:53 PM8/16/12
Most of this is nothing to do with the project, but specific to your setup. No, definitely nothing wrong with the project; you're not really even to a point where you're using the project.

zxing as a whole is not a library. You do not include anything from the project as a library, not android/. You do include core.jar in your libs/ folder as you found. Then you build your app around that.

On Thursday, August 16, 2012 8:10:29 PM UTC+1, oseparovic wrote:

What I finally got to fix the problem was to not list zxing as a library for my android project, and instead copy the core.jar that I built directly into the libs folder in the trunk of my project. From my understanding this might be because there is a non-jar file on the classpath and the above error is thrown when dex attempts to unzip one of these files. Android does print out your classpath but it's in a target that comes after the -dex target so it's not useful for debugging this problem.

Is this a bug with zxing or is there something wrong with the way I set up the zxing library? Thanks for any help you can provide.


Aug 16, 2012, 3:43:19 PM8/16/12
Ah my mistake. I can't remember how I came to the assumption that zxing/android was a library project, that should have been where I started to look for problems but the error was rather unhelpful. Would zxing benefit from having a specific library project that you can depend on? For example the ActionBarSherlock project that I mentioned above has a /library lib-project that I set up to be used by my project with just two calls:

android update lib-project -t android-15 -p .

android update project -p . -l ../ActionBarSherlock

and let android handle the rest (directories used are just examples). This would probably be cleaner and more portable than copying around jar files. If there's a better solution to what I'm doing please advise, I'm far from an android guru :)

Sean Owen

Aug 16, 2012, 5:48:35 PM8/16/12
There is a library: core.jar. You put it in libs/. There is no Android-specific library as it is not provided as such. It is provided for Intent-based integration.
Reply all
Reply to author
0 new messages