is the sdk containing more than shown in android.jar?

Common bugs/problems with the Android SDK the Emulator and the ADT-Plugin.

is the sdk containing more than shown in android.jar?

Postby janosch » Tue Nov 25, 2008 1:30 pm

Hello,

I have observed a strange behaviour that I can't explain. The only explanation I see is that android uses classes not listed in the android.jar . I have the following problem:

I have existing source files (+100) that use commons-logging. They obtain the Log by calling LogFactory.getLog(class)

I want to see the Log output but can't - so I want to redirect the output to logcat.

Therefor I've written a simple implementation of the org.commons.logging.Log Interface that calls the android.util.Log class.

now i had to make sure that LogFactory.getLog(class) returns that implementation. So I deleted(!) the LogFactory.class from the commons-logging.jar and added its source so I could modify it. I changed the method getLog() so that it returns my wrapper class.

I thought that would do the job, but when I install the apk I get:


11-25 11:43:07.386: DEBUG/dalvikvm(224): DexOpt: 'Lorg/apache/commons/logging/LogFactory;' has an earlier definition; blocking out
11-25 11:43:07.374: DEBUG/dalvikvm(224): DexOpt: 'Lorg/apache/commons/logging/LogConfigurationException;' has an earlier definition; blocking out
11-25 11:43:07.394: DEBUG/dalvikvm(224): DexOpt: 'Lorg/apache/commons/logging/impl/Jdk14Logger;' has an earlier definition; blocking out
.
.
.
(and so on)

I looked into my sources, I searched my libs and turned to the android.jar - but I didn't find more than one definition each. I allso stared the emulator with -wipe-data and cleaned the bin directory before build. No effect.
So all I can conclude is that andorid contains a hidden implementation of commons-logging.
does that sound reasonable, or is there something i could have forgotten to check?
janosch
Freshman
Freshman
 
Posts: 3
Joined: Fri Oct 31, 2008 4:08 pm

Top

Return to SDK/ADT/Emulator Problems

Who is online

Users browsing this forum: No registered users and 7 guests