• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Help: build issue on mac when upmerging ics

Dear experts,

Right now we faced an annoying issue only happening on mac laptop. We saw it during upmerging google ics release.
Any suggestion or tips is very much appreciated.

It happens on some mac while doesn't appear on others'. With same java version and build environment.

The java version is:
java version "1.6.0_24"
Java(TM) SE Runtime Environment (build 1.6.0_24-b07-334-9M3326)
Java HotSpot(TM) 64-Bit Server VM (build 19.1-b02-334, mixed mode)

The error is something like this.

Install: out/target/product/cdma_spyder-p1c_spyder/system/framework/framework.jarCompiling SDK Stubs: out/target/common/obj/JAVA_LIBRARIES/android_stubs_current_intermediates/classes.jar
out/target/common/obj/JAVA_LIBRARIES/android_stubs_current_intermediates/src/java/lang/StringBuffer.java:60: reverse() is already defined in java.lang.StringBuffer

We checked and found that, intermediate file out/target/common/obj/JAVA_LIBRARIES/android_stubs_current_intermediates/src/java/lang/StringBuffer.java is different in my mac server and Ted's laptop.

In my out/target/common/obj/JAVA_LIBRARIES/android_stubs_current_intermediates/src/java/lang/StringBuffer.java
function reverse() is only once.

public synchronized java.lang.StringBuffer reverse() { throw new RuntimeException("Stub!"); }

However in Ted's out/target/common/obj/JAVA_LIBRARIES/android_stubs_current_intermediates/src/java/lang/StringBuffer.java, it is twice.

public synchronized int lastIndexOf(java.lang.String arg0, int arg1) { throw new RuntimeException("Stub!"); }
public synchronized java.lang.StringBuffer reverse() { throw new RuntimeException("Stub!"); }
public synchronized java.lang.String toString() { throw new RuntimeException("Stub!"); }
public java.lang.AbstractStringBuilder reverse() { throw new RuntimeException("Stub!"); }


Do you know how this file java/lang/StringBuffer.java gets generated?
 
There seem to be a workaround, by manually invoking "javadoc" when the error happens, and then continue building.

I used "strace" to monitor the "make -j2" command, to find that the files under "out/target/common/obj/JAVA_LIBRARIES/android_stubs_current_intermediates/src" are created by "javadoc".

Then when the build error happens, I find the intermediate file "out/target/common/obj/JAVA_LIBRARIES/android_stubs_current_intermediates/src/java/io/PrintStream.java" is invalid (it has duplicated method declaration, one from super interface class, one from the class itself).

Then, I manually run:
javadoc \
\@out/target/common/obj/JAVA_LIBRARIES/api-stubs_intermediates/droiddoc-src-list \
-J-Xmx1280m \
-doclet com.google.doclava.Doclava \
-docletpath out/host/linux-x86/framework/jsilver.jar:out/host/linux-x86/framework/doclava.jar \
-templatedir build/tools/droiddoc/templates-sdk \
-htmldir frameworks/base/docs/html \
-bootclasspath /opt/java/jdk6/lib/../jre/lib/rt.jar \
-classpath out/target/common/obj/JAVA_LIBRARIES/bouncycastle_intermediates/classes.jar:out/target/common/obj/JAVA_LIBRARIES/core_intermediates/classes.jar:out/target/common/obj/JAVA_LIBRARIES/ext_intermediates/classes.jar:out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/classes.jar \
-sourcepath frameworks/base/core/java:frameworks/base/graphics/java:frameworks/base/location/java:frameworks/base/media/java:frameworks/base/drm/java:frameworks/base/ethernet/java:frameworks/base/opengl/java:frameworks/base/sax/java:frameworks/base/telephony/java:frameworks/base/wifi/java:frameworks/base/keystore/java:frameworks/base/icu4j/java:frameworks/base/voip/java:out/target/common/obj/JAVA_LIBRARIES/bouncycastle_intermediates/classes.jar:out/target/common/obj/JAVA_LIBRARIES/core_intermediates/classes.jar:out/target/common/obj/JAVA_LIBRARIES/ext_intermediates/classes.jar:out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/classes.jar \
-d out/target/common/docs/api-stubs \
-hdf page.build 7.7.0_22-eng.w20048.20111209.152233 -hdf page.now "09 12 2011 15:23" \
-knowntags ./frameworks/base/docs/knowntags.txt -since ./frameworks/base/api/1.xml 1 -since ./frameworks/base/api/2.xml 2 -since ./frameworks/base/api/3.xml 3 -since ./frameworks/base/api/4.xml 4 -since ./frameworks/base/api/5.xml 5 -since ./frameworks/base/api/6.xml 6 -since ./frameworks/base/api/7.xml 7 -since ./frameworks/base/api/8.xml 8 -since ./frameworks/base/api/9.xml 9 -since ./frameworks/base/api/10.xml 10 -since ./frameworks/base/api/11.xml 11 -since ./frameworks/base/api/12.xml 12 -since ./frameworks/base/api/13.xml 13 -since ./frameworks/base/api/14.txt 14 -werror -hide 113 -overview frameworks/base/core/java/overview.html -hdf sdk.version 4.0 -hdf sdk.rel.id 1 -hdf sdk.preview 0 -stubs out/target/common/obj/JAVA_LIBRARIES/android_stubs_current_intermediates/src -api out/target/common/obj/PACKAGING/public_api.txt -nodocs


Now, it's strange to see the newly created intermediate file "out/target/common/obj/JAVA_LIBRARIES/android_stubs_current_intermediates/src/java/io/PrintStream.java" becomes correct.
After that, I continue to "make -j2", and see the build survived and continued.



Not sure how to get a final fix. Really need your help here...
 
Back
Top Bottom