Got 'Unable to find package java.lang' while generating android-icu4j-host

297 views
Skip to first unread message

Ben Ma

unread,
Apr 6, 2017, 9:27:47 PM4/6/17
to Android Building
Now I'm stuck on it. I've read some about libcore/JavaLibrary.mk but can't figure out what's wrong.
Env: Ubuntu 16.04 in Docker, OpenJDK 8, using JACK(default behavior), using ccache, building Resurrection Remix but I think this problem is just within aosp's area.

Any suggestions may help me!

Here's the full log related to the bug:
[  5% 2238/41019] host Java: android-icu4j-host (/root/RR/out/host/common/obj/JAVA_LIBRARIES/android-icu4j-host_intermediates/classes)
FAILED
: /root/RR/out/host/common/obj/JAVA_LIBRARIES/android-icu4j-host_intermediates/classes-full-debug.jar
/bin/bash -c "(rm -f /root/RR/out/host/common/obj/JAVA_LIBRARIES/android-icu4j-host_intermediates/classes-full-debug.jar ) && (rm -rf /root/RR/out/host/common/obj/JAVA_LIBRARIES/android-icu4j-host_intermediates/classes ) && (mkdir -p /root/RR/out/host/common/obj/JAVA_LIBRARIES/android-icu4j-host_intermediates/ ) && (mkdir -p /root/RR/out/host/common/obj/JAVA_LIBRARIES/android-icu4j-host_intermediates/classes ) && (for f in  /root/RR/out/host/common/obj/JAVA_LIBRARIES/icu4j-icudata-host-jarjar_intermediates/javalib.jar  /root/RR/out/host/common/obj/JAVA_LIBRARIES/icu4j-icutzdata-host-jarjar_intermediates/javalib.jar; do if [ ! -f \$f ]; then echo Missing file \$f; exit 1; fi; unzip -qo \$f -d /root/RR/out/host/common/obj/JAVA_LIBRARIES/android-icu4j-host_intermediates/classes; done ) && (rm -rf /root/RR/out/host/common/obj/JAVA_LIBRARIES/android-icu4j-host_intermediates/classes/META-INF ) && (rm -f /root/RR/out/host/common/obj/JAVA_LIBRARIES/android-icu4j-host_intermediates/classes/java-source-list ) && (touch /root/RR/out/host/common/obj/JAVA_LIBRARIES/android-icu4j-host_intermediates/classes/java-source-list ) && (echo -n 'external/icu/android_icu4j/src/main/java/android/icu/impl/Assert.java external/icu/android_icu4j/src/main/java/android/icu/impl/BMPSet.java external/icu/android_icu4j/src/main/java/android/icu/impl/CacheBase.java external/icu/android_icu4j/src/main/java/android/icu/impl/CacheValue.java external/icu/android_icu4j/src/main/java/android/icu/impl/CalendarAstronomer.java external/icu/android_icu4j/src/main/java/android/icu/impl/CalendarCache.java external/icu/android_icu4j/src/main/java/android/icu/impl/CalendarData.java external/icu/android_icu4j/src/main/java/android/icu/impl/CalendarUtil.java ...(so many java files. I'm just cutting them out)... external/icu/android_icu4j/src/main/java/android/icu/util/VTimeZone.java external/icu/android_icu4j/src/main/java/android/icu/util/ValueIterator.java external/icu/android_icu4j/src/main/java/android/icu/util/VersionInfo.java ' >> /root/RR/out/host/common/obj/JAVA_LIBRARIES/android-icu4j-host_intermediates/classes/java-source-list ) && (if [ -d \"/root/RR/out/host/common/obj/JAVA_LIBRARIES/android-icu4j-host_intermediates/src\" ]; then find /root/RR/out/host/common/obj/JAVA_LIBRARIES/android-icu4j-host_intermediates/src -name '*.java' -and -not -name '.*' >> /root/RR/out/host/common/obj/JAVA_LIBRARIES/android-icu4j-host_intermediates/classes/java-source-list; fi ) && (tr ' ' '\\n' < /root/RR/out/host/common/obj/JAVA_LIBRARIES/android-icu4j-host_intermediates/classes/java-source-list | build/tools/normalize_path.py | sort -u > /root/RR/out/host/common/obj/JAVA_LIBRARIES/android-icu4j-host_intermediates/classes/java-source-list-uniq ) && (if [ -s /root/RR/out/host/common/obj/JAVA_LIBRARIES/android-icu4j-host_intermediates/classes/java-source-list-uniq ] ; then javac -J-Xmx1024M -Xmaxerrs 9999999 -encoding UTF-8  -bootclasspath /root/RR/out/host/common/obj/JAVA_LIBRARIES/core-oj-hostdex_intermediates/classes.jar:/root/RR/out/host/common/obj/JAVA_LIBRARIES/core-libart-hostdex_intermediates/classes.jar -classpath /root/RR/out/host/common/obj/JAVA_LIBRARIES/icu4j-icudata-host-jarjar_intermediates/javalib.jar:/root/RR/out/host/common/obj/JAVA_LIBRARIES/icu4j-icutzdata-host-jarjar_intermediates/javalib.jar  -extdirs \"\" -d /root/RR/out/host/common/obj/JAVA_LIBRARIES/android-icu4j-host_intermediates/classes -g  -source 1.8 -target 1.8 \\@/root/RR/out/host/common/obj/JAVA_LIBRARIES/android-icu4j-host_intermediates/classes/java-source-list-uniq || ( rm -rf /root/RR/out/host/common/obj/JAVA_LIBRARIES/android-icu4j-host_intermediates/classes ; exit 41 ) fi ) && (rm -f /root/RR/out/host/common/obj/JAVA_LIBRARIES/android-icu4j-host_intermediates/classes/java-source-list ) && (rm -f /root/RR/out/host/common/obj/JAVA_LIBRARIES/android-icu4j-host_intermediates/classes/java-source-list-uniq ) && (jar -cf /root/RR/out/host/common/obj/JAVA_LIBRARIES/android-icu4j-host_intermediates/classes-full-debug.jar -C /root/RR/out/host/common/obj/JAVA_LIBRARIES/android-icu4j-host_intermediates/classes . ) && (rm -f  /root/RR/out/host/common/obj/JAVA_LIBRARIES/android-icu4j-host_intermediates/classes-full-debug.jar.jar-arg-list ) && (touch  /root/RR/out/host/common/obj/JAVA_LIBRARIES/android-icu4j-host_intermediates/classes-full-debug.jar.jar-arg-list ) && (echo -n '-C \"external/icu/android_icu4j/resources\" \"android/icu/ICUConfig.properties\" -C \"external/icu/android_icu4j/resources\" \"android/icu/impl/duration/impl/data/index.txt\" -C \"external/icu/android_icu4j/resources\" \"android/icu/impl/duration/impl/data/pfd_ar_EG.xml\" -C \"external/icu/android_icu4j/resources\" \"android/icu/impl/duration/impl/data/pfd_ar_EG.xml.escaped\" -C \"external/icu/android_icu4j/resources\" \"android/icu/impl/duration/impl/data/pfd_en.xml\" -C \"external/icu/android_icu4j/resources\" \"android/icu/impl/duration/impl/data/pfd_es.xml\" -C \"external/icu/android_icu4j/resources\" \"android/icu/impl/duration/impl/data/pfd_fr.xml\" -C \"external/icu/android_icu4j/resources\" \"android/icu/impl/duration/impl/data/pfd_he_IL.xml\" -C \"external/icu/android_icu4j/resources\" \"android/icu/impl/duration/impl/data/pfd_hi.xml\" -C \"external/icu/android_icu4j/resources\" \"android/icu/impl/duration/impl/data/pfd_it.xml\" -C \"external/icu/android_icu4j/resources\" \"android/icu/impl/duration/impl/data/pfd_ja.xml\" -C \"external/icu/android_icu4j/resources\" \"android/icu/impl/duration/impl/data/pfd_ko.xml\" -C \"external/icu/android_icu4j/resources\" \"android/icu/impl/duration/impl/data/pfd_ru.xml\" -C \"external/icu/android_icu4j/resources\" \"android/icu/impl/duration/impl/data/pfd_th.xml\" -C \"external/icu/android_icu4j/resources\" \"android/icu/impl/duration/impl/data/pfd_zh_Hans.xml\" -C \"external/icu/android_icu4j/resources\" \"android/icu/impl/duration/impl/data/pfd_zh_Hans_SG.xml\" -C \"external/icu/android_icu4j/resources\" \"android/icu/impl/duration/impl/data/pfd_zh_Hant.xml\" -C \"external/icu/android_icu4j/resources\" \"android/icu/impl/duration/impl/data/pfd_zh_Hant_HK.xml\" ' >>  /root/RR/out/host/common/obj/JAVA_LIBRARIES/android-icu4j-host_intermediates/classes-full-debug.jar.jar-arg-list ) && (jar uf /root/RR/out/host/common/obj/JAVA_LIBRARIES/android-icu4j-host_intermediates/classes-full-debug.jar @/root/RR/out/host/common/obj/JAVA_LIBRARIES/android-icu4j-host_intermediates/classes-full-debug.jar.jar-arg-list ) && (rm -f /root/RR/out/host/common/obj/JAVA_LIBRARIES/android-icu4j-host_intermediates/classes-full-debug.jar.jar-arg-list )"
Fatal Error: Unable to find package java.lang in classpath or bootclasspath
在此输入代码...


Colin Cross

unread,
Apr 6, 2017, 9:39:57 PM4/6/17
to android-...@googlegroups.com
The java.lang classes should be in
/root/RR/out/host/common/obj/JAVA_LIBRARIES/core-oj-hostdex_intermediates/classes.jar,
which is listed in -bootclasspath in your command line. Can you see
if that file contains java.lang classes?
> --
> --
> You received this message because you are subscribed to the "Android
> Building" mailing list.
> To post to this group, send email to android-...@googlegroups.com
> To unsubscribe from this group, send email to
> android-buildi...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-building?hl=en
>
> ---
> You received this message because you are subscribed to the Google Groups
> "Android Building" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to android-buildi...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Ben Ma

unread,
Apr 7, 2017, 10:45:51 AM4/7/17
to Android Building
It seems `out/host/common/obj/JAVA_LIBRARIES/core-oj-hostdex_intermediates` doesn't exist.
I'm planning to build AOSP for a supported device to check if my environment has something wrong.
`ls` shows as the follow:

root@6fe939060d2a:~/RR# ls out/host/common/obj/JAVA_LIBRARIES/    
android
-icu4j-host_intermediates/                    guavalib_intermediates/                              json-prebuilt_intermediates/
antlr
-runtime_intermediates/                         hamcrest-host_intermediates/                         jsonlib_intermediates/
asm-5.0_intermediates/                               icu4j-icudata-host-jarjar_intermediates/             jsr305lib_intermediates/
compatibility
-common-util-hostsidelib_intermediates/ icu4j-icudata-host_intermediates/                    junit_intermediates/
compatibility
-host-util_intermediates/               icu4j-icutzdata-host-jarjar_intermediates/           kxml2-2.3.0_intermediates/
cts
-java-scanner-doclet_intermediates/               icu4j-icutzdata-host_intermediates/                  platform-test-annotations-host_intermediates/
cts
-java-scanner_intermediates/                      jarjar-apache-ant_intermediates/                     rmtypedefs_intermediates/
cts
-native-scanner_intermediates/                    jarjar-asm-commons_intermediates/                    tagsouplib_intermediates/
cts
-xml-generator_intermediates/                     jarjar-maven-plugin-api_intermediates/               tradefed-prebuilt_intermediates/
doclava_intermediates
/                               jarjar_intermediates/                                vogarexpectlib_intermediates/
guava
-tools_intermediates/                           jsilver_intermediates/



在 2017年4月7日星期五 UTC+8上午9:39:57,Colin Cross写道:

Vinicius Silva

unread,
Jun 29, 2018, 2:28:48 PM6/29/18
to Android Building
I'm facing the exact same issue. Did you solve it? How?
Thanks
Reply all
Reply to author
Forward
0 new messages