Eclipse + cupcake + referenced projects in build path = VerifyError

by Guillaume Perrot » Tue, 28 Apr 2009 23:03:06 GMT


Sponsored Links
 In the previous SDK releases, we have our application cut into 3
android projects:
* Project REAL (the real android project)
* Project LIB1 (a non executable android project, just to make android
reusable classes)
* Project LIB2 (same as LIB1)
LIB1 and LIB2 are android projects rather than J2SE ones because of
the API they use, indeed LIB1 and LIB2 use Android classes.
Project REAL has LIB1 and LIB2 in its project build path in Eclipse.

In SDK 1.0 and 1.1, no problem at all when running the project REAL
from Eclipse, it mixes the code of the 3 projects and produces one big
APK with everything in it.

But now in SDK 1.5, it installs 3 different APKs on the emulator or on
the phone (I tested both), and the project REAL immediately crashes
because of a VerifyError: it does not found a class that is in LIB1.

The size of the produced APK is smaller, indeed, LIB1 and LIB2 classes
are not in it...
I tried using uses-library in the manifest like google maps library
but it complains at installing, we have a "missing shared library"
error.
I tried adding class folders in build path, it compiles in Eclipse but
we still have VerifyError.
Same thing if we use external class folders in build path.

The only thing that worked for me was to add an eclipse folder, which
is in fact a symbolic link, and to make it a source folder. But that
solution is not convenient for us when because we share the projects
in SVN and so the paths are different. Using eclipse path variables
can do the trick but we waste some time to configure them so it's not
convenient enough.

Is there a way to restore the old behavior on other android projects
in build path ?


--~--~---------~--~----~------------~-------~--~----~