0

I'm trying to build AOSP from source code which is based on Android 6.0.1 for Nexus5 hammerhead. Therefore, the lunch combo is aosp_hammerheader-userdebug

I followed the instruction from AOSP page and prepared the virtual machine on Ubuntu 14.04. After 1 days download, I got the while source code. I just change the jvm heap size with -Xmx2048M. Then I try to compile, the process is ongoing.

After about 1 hour later, I got the compile error with /frameworks/support/v8/renderscript. A lot of error message like following.

ERROR: /home/vadmin/android/AOSP/frameworks/support/v8/renderscript/java/src/android/support/v8/renderscript/FieldPacker.java:187: android.util cannot be resolved
ERROR: /home/vadmin/android/AOSP/frameworks/support/v8/renderscript/java/src/android/support/v8/renderscript/FieldPacker.java:188: IllegalArgumentException cannot be resolved to a type
ERROR: /home/vadmin/android/AOSP/frameworks/support/v8/renderscript/java/src/android/support/v8/renderscript/FieldPacker.java:195: android.util cannot be resolved
ERROR: /home/vadmin/android/AOSP/frameworks/support/v8/renderscript/java/src/android/support/v8/renderscript/FieldPacker.java:196: IllegalArgumentException cannot be resolved to a type
ERROR: /home/vadmin/android/AOSP/frameworks/support/v8/renderscript/java/src/android/support/v8/renderscript/RenderScript.java:19: The import java.io cannot be resolved
ERROR: /home/vadmin/android/AOSP/frameworks/support/v8/renderscript/java/src/android/support/v8/renderscript/RenderScript.java:20: The import java.lang cannot be resolved

It seems missing the very basic library in source. I try to ignore this project, but this renderscript library is the dependency for Gallery2 project. I want this application on my rom.

Also I check the /frameworks/support folder, there is a Gradle project structure, then I use ./gradlew build to compile the /frameworks/support project, it works and show compile successful. After that, I will normal way make -j4 to compile again, it fail again.

Any help or tips for resolve this will be very helpful. Thanks.


Update at Mar 15

Follow the comment from @StephenHines. This issue was solved. Maybe I synced in the middle of a multi-project commit. Thanks to StephenHines

  • Without compile /frameworks/support/v8/renderscript. I also disable the project `/packages/apps/Gallery2` and `/frameworks/rs/java/tests/`, then compile successful. But this is just a workaround. Did there any good suggestion or information can help me to compile render script. – Destiny Peng Mar 14 '16 at 07:18
  • How did you pull down AOSP, what repo commands did you use? – Larry Schiefer Mar 14 '16 at 10:34
  • @LarrySchiefer Thanks for asking. I just use `repo sync` to pull the latest `master` source code from AOSP. And I didn't point a branch or any other tag, is there any tricks here? – Destiny Peng Mar 14 '16 at 15:59
  • the master branch is often not very stable. You'd be better of running `repo init` with a specific branch (with the `-b` switch), such as `android-6.0.0_r26` and building from there. Also, be sure to have OpenJDK 7 set as your default Java environment as newer Android builds require it. – Larry Schiefer Mar 14 '16 at 16:11
  • We actually really do keep aosp/master stable, although maybe you synced in the middle of a multi-project commit. Can you try running a top-level repo sync again today (i.e. "repo sync -c" from anywhere in your source tree). Pay attention to if it completes successfully or if it fails (i.e. exits with non-zero error code). Then please try to rebuild ("source build/envsetup.sh; lunch aosp_hammerhead-userdebug; m -j16"). – Stephen Hines Mar 14 '16 at 20:55
  • @StephenHines Thanks for your reply. I think the last time sync with master branch is success. I will try it again. When I got the result, I will update here. – Destiny Peng Mar 15 '16 at 05:20
  • @LarrySchiefer I want to use android-6.0.1 and I already used OpenJDK 8 as default Java environment. Thanks for your advise. I will try Stephen's way. Let's see what will happen :) – Destiny Peng Mar 15 '16 at 05:25
  • 1
    After `repo sync` the project again and rebuild it the compile was successful. Thanks to @Stephenhines. – Destiny Peng Mar 15 '16 at 07:14
  • Can you mark this resolved, now that it is working? Thanks. – Stephen Hines Mar 15 '16 at 22:00

1 Answers1

1

This issue was happened cause maybe I synced in the middle of a multi-project commit. With @StephenHines help, I tried running a top-level repo sync again (i.e. repo sync -c from anywhere in your source tree). Pay attention to if it completes successfully or if it fails (i.e. exits with non-zero error code). Then tried to rebuild (source build/envsetup.sh; lunch aosp_hammerhead-userdebug; m -j16). Then the issue resolved.